当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Port number is missing when page switches

问题描述:

I'm working on Java code setup in eclipse.created a dynamic web project.

I'm running the project via Apache tomcat server 6.0. able to run the code without any issues. But when I run the code the login page displays with the URL (local host:8080/example) after entering the logging in the URL is directed to (http://local host/example/home.jsp) and says page not found check the local host is correct .the same I'm able to access by manually entering port number in URL like (local host:8080/example/home.jsp.

The problem is if URL with port number it is working fine. But when page switches the URL is coming without port number.

Not able to access: localhost/example/home.jsp

Able to access: localhost:8080/example/home.jsp

Could you please let me know any server configurations I need to setup so it will automatically the port number is displayed when I switch the page.

Thanks

网友答案:

Try running the below command and load the application.

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

分享给朋友:
您可能感兴趣的文章:
随机阅读: