Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Submitting a form  RSS feed

 
Davendra Jesani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I currently run JSPs to a server on my PC using the following code:

<form action="http://localhost:8080/esystemstech/jsp/Add" method=\"post\" name="form" id="form">

I now want to submit these forms to the server which is on a different machine, hence I need to replace 'http://localhost:8080/esystemstech' with some sort of JSTL tag.

Does anyone know what the tag is?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you're asking.
Are you trying to dynamically change the action in a form tag?
 
Davendra Jesani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When I host the site on a web server, I cant use "localhost:8080/esystemstech/" as this will not link to my server which is on a different computer. Lets say you are to use my site, and if I use localhost:8080, it is posting to your computer, but I need to post it to my computer. Does that sound any clearer or am I still not explainin it right?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why aren't you using relative links?

Example:


Instead of:


This way, your code becomes portable and will work in any app on any server.
 
S Herod
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless you are explicitly trying to retrieve a image from another server, or intending to submit a form to a server other than the one the page was served from, relative paths really are the only way to go.

so



not



yes, you can muck around with obtaining the servers name and paths and all that sort of thing so you can detect the host and all that, but you'll just get into alot of trouble.

So you don't need a special tag, you just need to leave stuff out of the url.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!