How to access web application from other system?
How can I access a java web application from other system..?? Please guide me how to do? i need it ASAP..
Some of my code:
<body>
<form action="NewServlet" method="post" accept="image/png,image/jpg,image/jpeg" >
.........................开发者_开发问答//
<br><br>
<tr> <td>Image Link: </td>
<td> <input type="file" name="select" > </td> </tr>
.........................//few other lines
</body>
Follow the steps:
- Deploy your Java Web Application on other machine. [You can use
.war
file this way servlet and java code is not needed to be copied on server machine.] - Run the server.
- Now on any machine other than the machine where you deployed your application you can access your application by hitting the url
http://[deployed-machine-ip]:[port]/[App-Name]
.
I can get a grip of what your problems are after the conversions.
First of all you need to understand how web application and web browser work.
The web browser generates a HTTP GET request to server, server, e.g. tomcat, generates a html page and send it back to your web browser. That's a complete operation. Now you can see your rendered html on your web broswer.
On your page, you may have a form which can takes the file or text as its field. Once you submit the request by htting a button, the form is generally converted into HTTP POST request and send to server. If the POST contains file, your server will need to save the file stream before you can run a process on the file.
If you submit a path to a folder on your local machine through your web broswer, it is impossible for web application to gain access to that folder since it is a security risk. You will need to upload the contents of the folder to web application and process it on server. However, once they are processed, they will be on server and your local contents will not be changes. You will have to provide links for them to download the processed files back to their local machine. There is no way for the local files get changes through web broswer.
If this is not clear enough, let me know.
精彩评论