This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes How to send string through <a href> in servlet? 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 » Servlets
Bookmark "How to send string through <a href> in servlet?" Watch "How to send string through <a href> in servlet?" New topic
Author

How to send string through <a href> in servlet?

malik ge
Ranch Hand

Joined: May 13, 2011
Posts: 69
Hi,
I want to know is there a way to send the following string "someString" to some other servlet?

I have two servlets, one shows the following link and by clicking the link it redirects to the "servletTwo".

I want to know how to send "someString" through it. After the Ampersand sign.

I know that by inserting the text "This Is A String" directly after the "&" sign sends it.

But how to send string "someString" through it???

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60740
    
  65

Use string concatenation or a StringBuilder to build up the URL.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
malik ge
Ranch Hand

Joined: May 13, 2011
Posts: 69
Thank for making me, slap my forehead...

I totally forgot about the concatenation.

Ashish Babar
Greenhorn

Joined: Apr 10, 2013
Posts: 1
how do you receive string at another servlet !!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60740
    
  65

As a request parameter.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to send string through <a href> in servlet?
 
Similar Threads
Ajax with JSP and JSTL
Return string from javascript function and display in text area.
MessageDigest
Confused by session management.
not able to insert values in ms access database