Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTML/Servlet remove values from address bar

 
Peter X Tran
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I would like to know if you can help with a slight issue I have. I want to post a form via html. This form is passed onto a servlet and displayed on a separate page. Is it possible to hide the values that is show on the second page?

I want to show a page that is visible to everyone. The Url below works but it is too long and since the page has values, i cannot give this url to everyone to view as it will change very often. Here is an example of the url that I see and what I would like to see.

"http://localhost:8080/servicestatus/status?photoIB=green&severityIB=2&ib=test1&photoIC=green&severityIC=3&ic=test2&photoFMT=green&severityFMT=2&fmt=test3&photoEB=green&severityEB=&ebobs=&photoNC=green&severityNC=&nc="
I can view images and the input values on the page.


Is there a way to shorten the url but have the values still there. I tried to use post but the images and input are not shown in the page.

My intentions is to let everyone view the page.

This is the url that I would like with all the values of the first url.
http://localhost:8080/servicestatus/servlet1



Regards,

Pete
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is the long URL a problem?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The short URL could be a redirect to the long URL. There are different levels at which this can be implemented - the long URL could be a servlet init parameter to the servlet handling the short URL. That would require a redeploy and web app restart - which may or may not be acceptable, depending on how often it changes.

The long URL could also be read from a file or DB, and then there could be a normally hidden parameter to it that would force it to reload that value. Or it could automatically re-read the value every X minutes or hours. That would discard with the need for a redeploy and restart.

Or -if you have an Apache server in front of the servlet container- you can use its mod_rewrite module to handle it, either as an actual redirect, or as a forward.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A google search for "short url service" reveals lots of options for registering short pseudo URLs - including this Wikipedia article.

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!