• Post Reply Bookmark Topic Watch Topic
  • New Topic

can't get the value from the servlet in JSP

 
Ma Yao
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote the code in jsp:


then in the servlet I wrote this:


I get the result with:
The current Yes count is:
The current No count is:

and can't get the attribute, someone could tell me the reason, thanks.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do not use the param builtin to access scoped variables. So: ${yescount}
 
Ma Yao
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still the same problem after using the EL expression ${}
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
${} is not a valid expression.
 
Ma Yao
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
${}the EL expression.

I also add the lib :

<%@ taglib uri="http://java.sun.com/jsp/jstl/c
 
Surendra Kumar
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where in your servlet are you forwarding to the JSP?
You have to use RequestDispatcher to forward to the JSP, isn't it?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!