This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How will I fetch Values textfield values in jsp ?

 
subbu grandhi
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

might be this is a simple question,but still I didn't figured it out.

I have textfield with value "This is your Friend".I want display that textfield value using JSP inside same page.

I wrote the following code,but it's not working,it showing null



I will use that value in different ways,so I declared on variabale.

I hope,you understood what I faced .

Thanks
 
Prajakta Acharya
Ranch Hand
Posts: 138
Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to Ranch :)

For you to get the text field value in request paramter, the page will need to be submitted after which the container will include it as a request parameter.

What exactly is your flow? Are you submitting the page and expecting the value?
 
subbu grandhi
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am excepting value without submitting.
 
Prajakta Acharya
Ranch Hand
Posts: 138
Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats not possible.
If you are expecting any value while the page is rendered, you will need to have that value set in request scope and then access it in the page. E.g, if your URL is served by a servlet and the servlet forwards the request to JSP, the servlet will need to put that value in request.

 
subbu grandhi
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Prajakta Acharya Actually my textfield value defines the another JSP page name.this textfield value dynamically change based on database data.that's why I don't want to communicate with server.

is there any other way?

I tried like this also

t.jsp code



t1.jsp code:



even,this one also not working.

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this article to understand how JSP operates and why the JSP code can't get a value that won't be available until the future.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic