0

I'm coding a program in java that take a few information from a graph (X axis and Y axis), and then I need to take this information and pass to a JSP page.

this is the java

package view;

public class Axis{
       double[] axisX;
       double[] axisY;
       int test;

       public Axis(){
       }

       public void setAxisX(double[] axisX){
           this.axisX = axisX;
       }

       public void setAxisY(double[] axisY){
           this.axisY = axisY;
       }

       public double[] getAxisX(){
           return axisX;
       }

       public double[] getAxisY(){
           return axisY;
       }
}

Then in the JSP is this what I have to do?

<jsp:useBean id="view" class="view.Axis" scope="session"/>
Test: <%= view.getAxisX() %>
Luiggi Mendoza
  • 83,472
  • 15
  • 149
  • 315
Rikkin
  • 499
  • 1
  • 5
  • 19

1 Answers1

3

What you are basically trying to do is use Standard Actions :

<jsp:useBean id="view" class="view.Axis" scope="session"/>
<br> X :<jsp:getProperty name="view" property="axisX" />
<br> Y :<jsp:getProperty name="view" property="axisY" />

You can use EL/JSTL for this instead of Standard Actions.

Also read ,

How to avoid Java Code in JSP-Files?

Community
  • 1
  • 1
AllTooSir
  • 47,910
  • 16
  • 124
  • 159