i used a bean object like this:

<jsp:useBean id="game" class="Classes.Game" scope="session" />
 <jsp:setProperty name="game" property="*" />

in the calss Game there is a property that is an array of enum type that i defined.
i want to access the arrays values which are from the enum type.

I presume you implemented some setter and getter methods in your "Game" bean. Therefore you should be able to get them with something like game.getMyEnumArray(numPosition)

yes but i want to compare values inside array.
like this:

numPosition[i] == Enum.player1 ;

i cannot do this because the enums defenition in in Game calss
and the jsp does not recognize this kind of Enum.

in class Game i defined :

enum State
    {
      empty,player1,player2;   
    }

public class GameBoard {
    
    private final int N = 8;
    protected State[][] Board = new State[N][N];
}

i can get Board with getBoard, but i cannot compare it's values.

i imported my enum to the jsp page and it's working now.
thanks for the help.

my jsp project includes class Game:

public class Game {
    
    private final int N = 8;
    public State[][] Board = new State[N][N];
    public enum State
    {
      empty,player1,player2;   
    }
}

in my jsp page i wrote :

<%@page import="Classes.Game.State" %>.
<jsp:useBean id="game" class="Classes.Game" scope="session" />
 <jsp:setProperty name="game" property="*" />

<% if (game.getBoard()[i][j-1]==State.player1) { %>
                                      <td><img src="b.JPG" heigh="40" width="40"></td>
                                      <% } %>

the if statement is working due to the import line

Comments
Thank you for share solution
This question has already been answered. Start a new discussion instead.