powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Java [игнор отключен] [закрыт для гостей] / Cannot find any information on property 'userId'
3 сообщений из 3, страница 1 из 1
Cannot find any information on property 'userId'
    #33032636
zirex
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
--- 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
Cannot find any information on property 'userId'
    #33032693
А.Грасоff™ JE
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
что-то ты пропустил. 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
Cannot find any information on property 'userId'
    #33032704
Фотография peter6636
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Дружище 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
3 сообщений из 3, страница 1 из 1
Форумы / Java [игнор отключен] [закрыт для гостей] / Cannot find any information on property 'userId'
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


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