This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Passing parameters through the web browser (Response) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Passing parameters through the web browser (Response)" Watch "Passing parameters through the web browser (Response)" New topic
Author

Passing parameters through the web browser (Response)

Anita Vargas
Greenhorn

Joined: Jul 16, 2009
Posts: 13
Hello everybody!

I understad that you can pass the parameters for a Servlet through the web browser (I want to make an addition between two numbers), with something like this: http://localhost:6060/Servlet/Addition?n1=2&n2=3 where the result of the addition between n1 and n2 is 5. so far I can show this result through an HTML page, but my question is How can I show the result through the web browser also (just like the request parameters), I think it can be possible something like this http://localhost:6060/Servlet/Addition?n1=2&n2=3&result=5 ???.

How can I do it by code?? I think its something very simple but im very new to Servlets and i just dont know how to do it, now my code looks like this:



I will be very thankful if someone can help me.

Greetings from Mexico. Thanks in advance...

eat.sleep.code ;)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60788
    
  65

That doesn't make a whole lot of sense. Servlets generate responses, not requests. Unless you are talking about some kind of redirect?

What are you actually hoping to accomplish?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Anita Vargas
Greenhorn

Joined: Jul 16, 2009
Posts: 13
mmmm... I want to find a way to send the result not by HTML, and I was wondering if could show the result through the web browser or something else.

Thanks.
Anita Vargas
Greenhorn

Joined: Jul 16, 2009
Posts: 13
Ok, I think I found a simple way that it could work for my purposes, its a simple code like this (nio need to construct the HTML page):



Lot of thanks for your attention Bear! =)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60788
    
  65

Why? Without knowing what you are really trying to do, it's hard to hazard a guess.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing parameters through the web browser (Response)
 
Similar Threads
To use or not to use SingleThreadModel?
problem with java code
streaming output
fyi: pre/post increment with exception thrown on the line
Spring mvc question