• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing parameters through the web browser (Response)

 
Anita Vargas
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64175
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Anita Vargas
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64175
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why? Without knowing what you are really trying to do, it's hard to hazard a guess.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic