can't start my first app on struts2 - java

I'm new in java web apps. Do this example: http://www.tutorialspoint.com/struts_2/struts_examples.htm
But can't start it in browser. Tomcat is properly working and shows me it's start page for localhost:8080. When I do
localhost:8080/HelloWorldStruts2/index.jsp
request as it shown in the example I see only :
HTTP Status 404 - /HelloWorldStruts2/index.jsp
type Status report
message /HelloWorldStruts2/index.jsp
description The requested resource is not available.
Apache Tomcat/8.0.20
Please help to solve the problem.

Did it deploy the HelloWorldStruts2 module properly?
I suggest you check Tomcat logs (located in tomcat home -> logs) to see if an exception happened while deploying the Struts app.

Related

how to redirect an application to error page when accessing without context root

I am working on Jboss EAP 7 application server. My java application is configured with a context root of '/myapps' in jboss-web.xml file.
My issue here is when I access the application without context-root (till port number) I need to redirect the application to an error page (404 page) which is there in our application ear.
example : here is my app url - http://localhost:8102/myapps/login.
If I try to access the application like below URL it should redirect to a custom error jsp page.
http://localhost:8102/login.
Please let me know.
Thanks

The webpage cannot be found - HTTP 404 JSP page

Experts,
My dynamic web project having 3 JSP page and 3 servlets .. and everthing was working fine till date.
when i executed the same project today, it was showing this below message.
The webpage cannot be found - HTTP 404
I deleted the whole project after trying multiple checks... now in web.xml if i remove the servlets section, its displaying the jsp content. but if i add the servlet back its throwing same page cannot be found :(
no error in project and i dont see any logs in eclipse... can someone please tel me why this is happening?
Appreciate your input. Thanks
Below are a few general suggestions on debugging web apps:
3 and 4 would be the first checks for 404.
Try to start the web app in the debug mode, and place the break point in the servlet method: any hit? (or just put a System.out.println in the Servlet);
Check the structure of the dynamic web project in Eclipse: are the compiled java classes of the servlets in there?
Check the context path (url) of the dynamic web project in eclipse project config: not accidentally changed?
Check the log files of the tomcat (access logs and catalina logs) your dynamic web project is associated with.

WAR deployment in tomcar

I need some advise over here. I have deployed a java based app on tomcat server. Tomcat server is installed on aws cloud. I am using the URL as hostname:portno/WAR file name to run the app and When i try to hit the app on browser it throws an error 404. However, when i add index.html after the URL or any other name with .html extsn like for ex hostname:port/warname/abc.html my app runs fine. Can you please advise why it is not running without index.html.
Answer to your question has got to do something with the accepted answer in this thread
How does Tomcat find the HOME PAGE of my Web App?
Simply put, Under WEB-INF/web.xml a home page has to be defined, if nothing is defined then what ever is defined in TOMCAT_HOME/conf/web.xml file will be considered as home page by tomcat server
so in your case I think you did not define a specific home page in WEB-INF/web.xml, that is why tomcat was searching for index.html page which is as per default configuration but index.html is not available to tomcat, so you were seeing 404 error. As soon as you put index.html file there then everything started to work for you

Not able to create custom error for Spring jersey application

We have a web based application with Front end in Angular JS 1 and REST service with Spring jersey frame work.We are using Spring 3.We have deployed our project in Tomcat 9.We have deployed angular js part as a separate project and REST service is build as a war file and deployed separately.
Suppose our application url is https://10.100.200.300:8443/DEMO.When we are trying to access the URL with a wrong value say https://10.100.200.300:8443/DEMO_TEST we are getting the error 404 i.e. resource not found by the tomcat server.We want to show some customized error page for 404 or any other tomcat error. Please suggest how to do it?
You can have a look here - Configure spring boot to redirect 404 to a single page app
Make spring configuration as mentioned in above answer and reroute it to your desired page.

Deploying a Jax-WS application locally - HTTP Status 404

I have setup a local server running in eclipse. It is to run my max-ws application which I have been making.
Once the server has started i can proceed to the following directory to view the management console;
> http://localhost:8080/
The name of my war file is hotornotserver.war - so assuming i deploy the war in the management console i should then be able to proceed to the following directory to view the wsdl.
> http://localhost:8080/hotornotserver?wsdl
As it stands when i do this i get the following error;
HTTP Status 404 - /hotornotserver
type Status report
message /hotornotserver
description The requested resource (/hotornotserver) is not available.
JBoss Web/7.0.1.Final
Baically i am interested in finding out how I can call methods on my local web service to perform some analysis on metrics / performance however I keep getting the error above. Some help would be much appreciated.
Thanks

Categories

Resources