Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use dynamically value by using <jsp:useBean> tag?

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends...

i just curious, how to use <jsp:useBean> tag with dynamic value?..
i want to use that bean to "send a message" to JSP from servlet..
example the application rule is like this..
1.) fill some texts in input.jsp
2.) servlet will validate all of the value which has submitted..
3.) if there is any null value the servlet will redirect to input.jsp and show a message (under the form) and give an information that the value must be not null..
How to configure this?.. do i have to use <jsp:useBean> tag?
if i have to use <jsp:useBean> tag how to set value dynamically in servlet?

4.) if there isn't null value the servlet will input that value to the table..

This is my bean :


and here is my jsp file :


actually i want to handle a message sending from to servlet to JSP.. (but iam trying to using <jsp:useBean> tag)..
maybe any another way?..

iam so sorry for the basic question...

Thanks in advance..
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In servlet, create a scoped variable:



In JSP, retrieve and display message:



P.S. You forward, not redirect, from the servlet to the JSP.

You don't need to get involved with <jsp:useBean/> unless you need to create beans within the JSP.
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Bear Bibeault

Thanks sir... it could ran well..
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam learning to migrate from Apache Tomcat 6 to Glassfish..

i use glassfish-v2ur1..
in tomcat 6 this code not cause error...



but when i tried to deploy to glassfish, this is cause error...
here is the message error :


Thanks in advance sir..
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you cant do this. you will get java.lang.IllegalArgumentException regardless of the web server
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, Thanks sir..

The problem is i redirect and not forward my Jsp page..
i did wrong notice the code..

Thanks in advance sir..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!