• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

request time expression

 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<jsp:setProperty name="address"
property="city"
value="<%= theCity %>" />

what is the theCity in here:

I used it as follows ,But it says name cann't be resolve

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you didn't define it, and it's not a JSP implicit variable, then it does not exist.
 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is mean not created.
this is my form


what else shuld i have to created ?
 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cann't i used this to retrive the forms detail

 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



What is "<%= name %>" here ? If you say its form input element "name" , i m afraid you can use like that.
How do you retrieve form element in Servlet ? using request object ? the same applies to JSP also . But JSP has 2 way to go

Use EL , the most simple way to get it. ${param.name}

Other bad way is to use scriplets like request.getParameter("name");
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aruna sameera wrote:cann't i used this to retrive the forms detail

No. In a modern JSP, you'd do that with the EL param built-in map; or better yet, you'd submit to a controller rather than a JSP.

But since you are still using old-fashioned scriptlets, you'd use the API on the request as Balu pointed out.

You really either need to read the JSP Specification, or find a good JSP tutorial. The questions you are asking show that you do not have a basic understand of what JSP is and how it operates. You can start with this article that describes JSP concepts and basic operation.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic