when we directly upload JSP page into tomcat where application deployed directory then why we don't need to restart Tomcat? how tomcat know that it has new JSP page?
when user hit the url /myapp/mynewjsp.jsp He/She always get new jsp deployed page.
Tomcat has an auto deploy feature. When you update JSP files it detects you have done so, compiles it, and replaces the old compiled JSP page with the new one that it compiles into a java class.
http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html
If you don't want that to happen, you can turn off the auto deploy feature for your web application. It is described in the link how you do that.
Hey you can use jetty plugin for auto deploying tomcat folder . You don't need to paste your file on webapps folder. If you using maven project structure then add jetty plugin on pom.xml file . There is some command to run like mvn jetty:run etc... May these solution get you out from these problem
Related
I have made a website using Tomcat Server on Eclipse Mars 2.0 IDE. When I run it on server, I have to manually add the name of the first (home) page of the website i.e the JSP/HTML file.
I want the website to open directly on the server so tell me how to do that please.
If you put an index.html into src/main/resources/static/ and reload the server does it show the content of the index page? If you have no static folder then go ahead and create one :)
In general you have to decide for a context-root which is basically the name of the application. If the name of the application is 'myapp' and the context-root is set to 'myapp' too then you should be able to see the website at serverip:port/myapp/.
If your project is configured as a WebProject you should be able to see Web Project Settings in the properties of the project itself. There you can adjust the context root. If you leave it empty it means that your application will be reachable at serverip:port/.
you can change your welcome-file-list in web.xml
you can refer this
https://cloud.google.com/appengine/docs/flexible/java/configuring-the-web-xml-deployment-descriptor
or look for Configuring the web.xml deployment descriptor
Hi I already develop my application using Netbeans IDE.
Now I want to run my application in Tomcat server for actual use. I already copy my project to tomcat/webapps.
But when I tried to run my application:
http://localhost:8081/myAppFolder/
it gives me an error message :The requested resource (/Opportunities-Registration/) is not available.
I should change the url to make it work:
http://localhost:8081/Opportunities-Registration/web/index.jsp
How can I open my application using http://localhost:8081/myAppFolder/ insteand of http://localhost:8081/Opportunities-Registration/web/index.jsp ?
Update:
All my servlet is also become 404 not found
Thank you
SOLVED
Solution:
1. copy .war file which is contained in dist folder of your netbeans project
2. Place your .war file to tomcat/webapps
3. Start your tomcat
4. You are good to go
I am new to java web programming and eclipse-apache Tomcat. I have small login web-application which includes (one jsp page , one servlet class).
I want to configure/deploy this application on apache web application manager. I mean I don't want to run this application in eclipse. I hope you understand my point.
Whenever I run my server in eclipse it run successfully. But when I want to open apache default page by typing http://localhost:8080 or http://localhost:8080 to configure my app It wouldn't open.
Please advice me.
To deploy a web application on Tomcat, you need to first compile your web application into a WAR file. Then, take that WAR file (let's assume it's called "MyApp.WAR") and put that into the tomcat/webapps directory. Restart the tomcat service. Tomcat will extract that WAR to a folder in the webapps directory. After that, any request to localhost:8080/MyApp will go to your webapp.
Make sure you have java installed, and add JAVA_HOME to your environment variable. (it is the path to java installation directory for e.g. C:\Program Files\java\jdk-1.6)
i.e
JAVA_HOME=C:\Program Files\java\jdk-1.6
install TOMCAT from here "http://tomcat.apache.org/download-70.cgi"
make sure you do not install it in you "c:\program files" due to some permission issues.
Lets say you installed tomcat at "c:\webserver\apache-tomcat\" this is your CATALINA_HOME, add it to your environment variable
i.e CATALINA_HOME=c:\webserver\apache-tomcat\
to acess tomcat webapp manager you need to configure user in %CATALINA_HOME%\conf\tomcat-users.xml
Add a role and a user :
Have your WAR file ready with you (this is how you create WAR "How to make war file in Eclipse")
move your WAR file to "%CATALINA_HOME%\webapp" directory. lets say "TestWeb.WAR" is your application with index.jsp page in it.
Now go to your %CALALINA_HOME%\bin and launch the startup.bat file (you would be using startup.bat to start and shutdown.bat to stop tomcat)
once tomcat is up and running check http://localhost:8080 is working fine.
P.S. If port 80 is already in use then try configuring your tomcat to some other unused PORT here "http://www.mkyong.com/tomcat/how-to-change-tomcat-default-port/"
go to your browser type http://localhost:8080/TestWeb/index.jsp
now you can to lot of configuration to your web app like having a default page and all
Hope this help you !
Normally eclipse uses Tomcat as an eclipse project, hence it uses metadata.
Server > Double click on the tomcat server instance > Server Location > Select "Use Tomcat installation"
Update: Tested just now. Set Deploy path to webapps folder. Works fine :)
I am trying to create a new jsp-file in eclipse
I installed tomcat server and created new dynamic web content.
now i want to create a new jsp file, but each time i try to create the jsp file eclipse give me the warning message shown on the image posted below.
please let me know how to load and run the jsp files using eclipse correctly.
You seems to be creating JSPs in a non-Java eclipse project and hence this warning is coming.
To run a jsp file you need a container like Tomcat. You can configure Tomcat under Runtime in eclipse. Follow this link to learn more about configuring Tomcat with eclipse:
http://www.eclipse.org/webtools/jst/components/ws/M4/tutorials/InstallTomcat.html
I am a PHP programmer.But i have a website code which was developed in jsp technology..
I dont know the environment of jsp engine. I wan to run my website in my localhost using Tomcat server..Please help me to do that...
You first need to install and download Tomcat. Of course you need to have a Java runtime in your machine. The website should have been given to you as a WAR file. To install it, simply copy the WAR file in the webapps folder of Tomcat. If you only have a bunch of JSP files, put them in the ROOT folder of Tomcat.