Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Java [игнор отключен] [закрыт для гостей] / Cannot find any information on property 'userId' / 3 сообщений из 3, страница 1 из 1
25.04.2005, 10:06
    #33032636
zirex
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Cannot find any information on property 'userId'
--- JSP ---

<jsp:useBean id = "_UserOptions"
class = "my.util.UserOptions"
scope = "session"/>

<html>
The value is <jsp:getProperty name="_UserOptions" property="userId"/>
</html>

--- JAVA --

package my.util;

public class UserOptions {
private String userId = "UserIDVALUE";

public UserOptions() {

}
public String getUserId() {
return this.userId;
}
}

Результат:
org.apache.jasper.JasperException: Cannot find any information on property 'userId' in a bean of type 'my.util.UserOptions'

в чем грабли?
...
Рейтинг: 0 / 0
25.04.2005, 10:23
    #33032693
А.Грасоff™ JE
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Cannot find any information on property 'userId'
что-то ты пропустил. tomcat 5.5.9:

UserOptions.java
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
 package  my.util;

 public   class  UserOptions {
   private  String userId = "UserIDVALUE";

   public  String getUserId() {
     return  userId;
  }
}

test.jsp
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><title>Simple jsp page</title></head>
<body>
<jsp:useBean id="_UserOptions" class="my.util.UserOptions" scope="session"/>
The value is <jsp:getProperty name="_UserOptions" property="userId"/>
</body>
</html>

-- html-source (браузер) --
Код: plaintext
1.
2.
3.
4.
5.
6.
<html>
<head><title>Simple jsp page</title></head>
<body>

The value is UserIDVALUE</body>
</html>
...
Рейтинг: 0 / 0
25.04.2005, 10:27
    #33032704
peter6636
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Cannot find any information on property 'userId'
Дружище zirex, используй пожалуйста src,согласись так гораздо прозрачнее:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
<jsp:useBean id = "_UserOptions"
 class  = "my.util.UserOptions"
scope = "session"/>

<html>
The value is <jsp:getProperty name="_UserOptions" property="userId"/>
</html>

--- JAVA --

 package  my.util;

 public   class  UserOptions {
 private  String userId = "UserIDVALUE";

 public  UserOptions() {

}
 public  String getUserId() {
 return   this .userId;
}
}

...
Рейтинг: 0 / 0
Форумы / Java [игнор отключен] [закрыт для гостей] / Cannot find any information on property 'userId' / 3 сообщений из 3, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]