Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hyperlink data retrieve

 
kunal vermaa
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can we send data through hyperlink..? how can we retrieve it on the next page..? please help..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65116
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sending data in a link is just basic HTTP. Look up the concept of a "query string".

Retrieving the request parameters in a servlet (preferred) is easy via request.getParameter(), and in a JSP using the EL -- for example, ${param.someParameter}.
 
kunal vermaa
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please explain it for JSP in detail.. how can i retrieve data in a JSP forwarded from another JSP through a hyperlink..?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65116
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forwarding is a different matter -- you asked about links. Which is it?
 
kunal vermaa
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i m sending data from 1st jsp to 2nd jsp through a hyperlink.. tell me how can i retreive the data on 2nd jsp.. please explain the methods clearly..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65116
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, for that, I've already given you the information you need to start digging in. Place the data on the query string (no, I'm not going to look it up for you -- please show some effort of your own), and retrieve it with the param built-in map of the EL in the target JSP.
 
kunal vermaa
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


this is my hyperlink.. i want to retrieve "name" on other jsp.. i m not familiar with the method you are telling me.. please explain..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65116
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
${param.name}

Look up the concept of the JSP Expression Language (EL).

It's what you should be using on your pages along with the JSTL in place of old-fashioned Java scriptlets.
 
kunal vermaa
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot bro..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic