wood burning stoves 2.0*
The moose likes JSP and the fly likes request time expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "request time expression" Watch "request time expression" New topic
Author

request time expression

sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1071
<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

Joined: Jan 10, 2002
Posts: 60766
    
  65

If you didn't define it, and it's not a JSP implicit variable, then it does not exist.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1071
what is mean not created.
this is my form


what else shuld i have to created ?
sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1071
cann't i used this to retrive the forms detail

Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874




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

Joined: Jan 10, 2002
Posts: 60766
    
  65

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.
 
subject: request time expression
 
Similar Threads
include directive doesn't work
how to use beanName
jsp:getProperty gives null
retrive serialize files data ERROR
give another jsp to action