You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Karen Goh <ka...@yahoo.com.INVALID> on 2018/11/18 04:01:35 UTC

http status 404 - not found

Hello Tomcat user group,

I hope that this question is valid cos I googled and many related issue like this pointed to server problem.

Tomcat version : 8.5.24
IDE : Eclipse Oxygen
OS : Windows 10

Basically, I have created a maven structured web app and after right-click my tutorRegister page, and the form submitted, http status 404 appeared.

This is what appeared in my browser :

 /webApp-hi5/$%7BpageContext.request.contextPath%7D/addTutor

I have checked my past project and there was no problem in getting the form submitted but when I made the project into maven type, I am getting the above error.

	<form name="tutorRegister" method="POST" action="${pageContext.request.contextPath}/addTutor"

Here's my pom.xml ;

<modelVersion>4.0.0</modelVersion>

	<groupId>com.hi5Supreme.web</groupId>
	<artifactId>webApp-hi5</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>war</packaging>

	<name>webApp-hi5 Maven Webapp</name>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
	</properties>


	<build>
		<finalName>webApp-hi5</finalName>
		<resources>		
		<resource>
      <directory>src/main/webapp</directory>
    </resource>
    </resources>
		<pluginManagement><!-- lock down plugins versions to avoid using Maven 
				defaults (may be moved to parent pom) -->
			<plugins>
				<plugin>
					<artifactId>maven-clean-plugin</artifactId>
					<version>3.0.0</version>
				</plugin>
				<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
				<plugin>
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.0.2</version>
				</plugin>
				<plugin>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.7.0</version>
				</plugin>
				<plugin>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.20.1</version>
				</plugin>
				<plugin>
					<artifactId>maven-war-plugin</artifactId>
					<version>3.2.0</version>
					<configuration>
					<warName>webApp-hi5</warName>
					</configuration>
				</plugin>
				<plugin>
					<artifactId>maven-install-plugin</artifactId>
					<version>2.5.2</version>
				</plugin>
				<plugin>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.8.2</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<dependencies>
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>javax.servlet.jsp-api</artifactId>
			<version>2.3.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jsp-api</artifactId>
			<version>2.0</version>
		</dependency>
		<dependency>
			<groupId>jstl</groupId>
			<artifactId>jstl</artifactId>
			<scope>provided</scope>
			<version>1.2</version>			
		</dependency>
		<!-- LOG4J for JDBC -->
		<dependency>
			<groupId>org.lazyluke</groupId>
			<artifactId>log4jdbc-remix</artifactId>
			<version>0.2.7</version>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>8.0.12</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>3.1.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>

Hope someone can let me know how if I have missed out anything.

Tks.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: http status 404 - not found

Posted by Salil Misra <th...@gmail.com>.
Just a quick check , have you saved your view page as a JSP and not as HTML
? If its saved as HTML , this might be the possible cause.

Thanks.



On Sun, 18 Nov 2018 at 09:31, Karen Goh <ka...@yahoo.com.invalid>
wrote:

> Hello Tomcat user group,
>
> I hope that this question is valid cos I googled and many related issue
> like this pointed to server problem.
>
> Tomcat version : 8.5.24
> IDE : Eclipse Oxygen
> OS : Windows 10
>
> Basically, I have created a maven structured web app and after right-click
> my tutorRegister page, and the form submitted, http status 404 appeared.
>
> This is what appeared in my browser :
>
>  /webApp-hi5/$%7BpageContext.request.contextPath%7D/addTutor
>
> I have checked my past project and there was no problem in getting the
> form submitted but when I made the project into maven type, I am getting
> the above error.
>
>         <form name="tutorRegister" method="POST"
> action="${pageContext.request.contextPath}/addTutor"
>
> Here's my pom.xml ;
>
> <modelVersion>4.0.0</modelVersion>
>
>         <groupId>com.hi5Supreme.web</groupId>
>         <artifactId>webApp-hi5</artifactId>
>         <version>0.0.1-SNAPSHOT</version>
>         <packaging>war</packaging>
>
>         <name>webApp-hi5 Maven Webapp</name>
>         <properties>
>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>                 <maven.compiler.source>1.8</maven.compiler.source>
>                 <maven.compiler.target>1.8</maven.compiler.target>
>         </properties>
>
>
>         <build>
>                 <finalName>webApp-hi5</finalName>
>                 <resources>
>                 <resource>
>       <directory>src/main/webapp</directory>
>     </resource>
>     </resources>
>                 <pluginManagement><!-- lock down plugins versions to avoid
> using Maven
>                                 defaults (may be moved to parent pom) -->
>                         <plugins>
>                                 <plugin>
>
> <artifactId>maven-clean-plugin</artifactId>
>                                         <version>3.0.0</version>
>                                 </plugin>
>                                 <!-- see
> http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging
> -->
>                                 <plugin>
>
> <artifactId>maven-resources-plugin</artifactId>
>                                         <version>3.0.2</version>
>                                 </plugin>
>                                 <plugin>
>
> <artifactId>maven-compiler-plugin</artifactId>
>                                         <version>3.7.0</version>
>                                 </plugin>
>                                 <plugin>
>
> <artifactId>maven-surefire-plugin</artifactId>
>                                         <version>2.20.1</version>
>                                 </plugin>
>                                 <plugin>
>
> <artifactId>maven-war-plugin</artifactId>
>                                         <version>3.2.0</version>
>                                         <configuration>
>                                         <warName>webApp-hi5</warName>
>                                         </configuration>
>                                 </plugin>
>                                 <plugin>
>
> <artifactId>maven-install-plugin</artifactId>
>                                         <version>2.5.2</version>
>                                 </plugin>
>                                 <plugin>
>
> <artifactId>maven-deploy-plugin</artifactId>
>                                         <version>2.8.2</version>
>                                 </plugin>
>                         </plugins>
>                 </pluginManagement>
>         </build>
>         <dependencies>
>                 <dependency>
>                         <groupId>javax.servlet.jsp</groupId>
>                         <artifactId>javax.servlet.jsp-api</artifactId>
>                         <version>2.3.1</version>
>                         <scope>provided</scope>
>                 </dependency>
>                 <dependency>
>                         <groupId>javax.servlet</groupId>
>                         <artifactId>jsp-api</artifactId>
>                         <version>2.0</version>
>                 </dependency>
>                 <dependency>
>                         <groupId>jstl</groupId>
>                         <artifactId>jstl</artifactId>
>                         <scope>provided</scope>
>                         <version>1.2</version>
>                 </dependency>
>                 <!-- LOG4J for JDBC -->
>                 <dependency>
>                         <groupId>org.lazyluke</groupId>
>                         <artifactId>log4jdbc-remix</artifactId>
>                         <version>0.2.7</version>
>                 </dependency>
>                 <dependency>
>                         <groupId>mysql</groupId>
>                         <artifactId>mysql-connector-java</artifactId>
>                         <version>8.0.12</version>
>                         <scope>provided</scope>
>                 </dependency>
>                 <dependency>
>                         <groupId>javax.servlet</groupId>
>                         <artifactId>javax.servlet-api</artifactId>
>                         <version>3.1.0</version>
>                         <scope>provided</scope>
>                 </dependency>
>                 <dependency>
>                         <groupId>junit</groupId>
>                         <artifactId>junit</artifactId>
>                         <version>4.11</version>
>                         <scope>test</scope>
>                 </dependency>
>         </dependencies>
> </project>
>
> Hope someone can let me know how if I have missed out anything.
>
> Tks.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: http status 404 - not found

Posted by Mark Thomas <ma...@apache.org>.
On 18/11/2018 04:01, Karen Goh wrote:
> Hello Tomcat user group,
> 
> I hope that this question is valid cos I googled and many related issue like this pointed to server problem.

The question is valid but this is an application problem, not a server
problem.

> Tomcat version : 8.5.24> IDE : Eclipse Oxygen
> OS : Windows 10

Thanks for the OS and Tomcat version information. I'd recommend you
include the version of Java you are using as well. Generally, the Tomcat
version is the most useful, followed by the Java version and then the OS
information.

> Basically, I have created a maven structured web app and after right-click my tutorRegister page, and the form submitted, http status 404 appeared.
> 
> This is what appeared in my browser :
> 
>  /webApp-hi5/$%7BpageContext.request.contextPath%7D/addTutor

OK. Tomcat will decode those %nn sequences before mapping the request to
a servlet so Tomcat will see:

/webApp-hi5/${pageContext.request.contextPath}/addTutor

> I have checked my past project and there was no problem in getting the form submitted but when I made the project into maven type, I am getting the above error.
> 
> 	<form name="tutorRegister" method="POST" action="${pageContext.request.contextPath}/addTutor"

The EL has not been processed. It has been treated as template text.
Since the string does not start with '/' it has been treated as relative
to the current page (which I assume was '/webApp-hi5/something').

You need to find out why the EL in the form isn't being processed as EL.

Things to look at:
- file name
- version declared for web.xml
- the JSP specification and look for "Deactivating EL"

> Here's my pom.xml ;

<snip/>

> 	<dependencies>
> 		<dependency>
> 			<groupId>javax.servlet.jsp</groupId>
> 			<artifactId>javax.servlet.jsp-api</artifactId>
> 			<version>2.3.1</version>
> 			<scope>provided</scope>
> 		</dependency>

This appears to be relevant given what you'll find in the JSP specification.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: http status 404 - not found

Posted by Arjuna Bandara <ar...@gmail.com>.
Hi,

Can you explain more about the issue and update problem with the console
output?

Was the maven building successful? Try run clean build with ' clean build
-e'. You may have full stack trace.

-
Arjuna


On Sun, 18 Nov 2018 9:31 am Karen Goh, <ka...@yahoo.com.invalid> wrote:

> Hello Tomcat user group,
>
> I hope that this question is valid cos I googled and many related issue
> like this pointed to server problem.
>
> Tomcat version : 8.5.24
> IDE : Eclipse Oxygen
> OS : Windows 10
>
> Basically, I have created a maven structured web app and after right-click
> my tutorRegister page, and the form submitted, http status 404 appeared.
>
> This is what appeared in my browser :
>
>  /webApp-hi5/$%7BpageContext.request.contextPath%7D/addTutor
>
> I have checked my past project and there was no problem in getting the
> form submitted but when I made the project into maven type, I am getting
> the above error.
>
>         <form name="tutorRegister" method="POST"
> action="${pageContext.request.contextPath}/addTutor"
>
> Here's my pom.xml ;
>
> <modelVersion>4.0.0</modelVersion>
>
>         <groupId>com.hi5Supreme.web</groupId>
>         <artifactId>webApp-hi5</artifactId>
>         <version>0.0.1-SNAPSHOT</version>
>         <packaging>war</packaging>
>
>         <name>webApp-hi5 Maven Webapp</name>
>         <properties>
>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>                 <maven.compiler.source>1.8</maven.compiler.source>
>                 <maven.compiler.target>1.8</maven.compiler.target>
>         </properties>
>
>
>         <build>
>                 <finalName>webApp-hi5</finalName>
>                 <resources>
>                 <resource>
>       <directory>src/main/webapp</directory>
>     </resource>
>     </resources>
>                 <pluginManagement><!-- lock down plugins versions to avoid
> using Maven
>                                 defaults (may be moved to parent pom) -->
>                         <plugins>
>                                 <plugin>
>
> <artifactId>maven-clean-plugin</artifactId>
>                                         <version>3.0.0</version>
>                                 </plugin>
>                                 <!-- see
> http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging
> -->
>                                 <plugin>
>
> <artifactId>maven-resources-plugin</artifactId>
>                                         <version>3.0.2</version>
>                                 </plugin>
>                                 <plugin>
>
> <artifactId>maven-compiler-plugin</artifactId>
>                                         <version>3.7.0</version>
>                                 </plugin>
>                                 <plugin>
>
> <artifactId>maven-surefire-plugin</artifactId>
>                                         <version>2.20.1</version>
>                                 </plugin>
>                                 <plugin>
>
> <artifactId>maven-war-plugin</artifactId>
>                                         <version>3.2.0</version>
>                                         <configuration>
>                                         <warName>webApp-hi5</warName>
>                                         </configuration>
>                                 </plugin>
>                                 <plugin>
>
> <artifactId>maven-install-plugin</artifactId>
>                                         <version>2.5.2</version>
>                                 </plugin>
>                                 <plugin>
>
> <artifactId>maven-deploy-plugin</artifactId>
>                                         <version>2.8.2</version>
>                                 </plugin>
>                         </plugins>
>                 </pluginManagement>
>         </build>
>         <dependencies>
>                 <dependency>
>                         <groupId>javax.servlet.jsp</groupId>
>                         <artifactId>javax.servlet.jsp-api</artifactId>
>                         <version>2.3.1</version>
>                         <scope>provided</scope>
>                 </dependency>
>                 <dependency>
>                         <groupId>javax.servlet</groupId>
>                         <artifactId>jsp-api</artifactId>
>                         <version>2.0</version>
>                 </dependency>
>                 <dependency>
>                         <groupId>jstl</groupId>
>                         <artifactId>jstl</artifactId>
>                         <scope>provided</scope>
>                         <version>1.2</version>
>                 </dependency>
>                 <!-- LOG4J for JDBC -->
>                 <dependency>
>                         <groupId>org.lazyluke</groupId>
>                         <artifactId>log4jdbc-remix</artifactId>
>                         <version>0.2.7</version>
>                 </dependency>
>                 <dependency>
>                         <groupId>mysql</groupId>
>                         <artifactId>mysql-connector-java</artifactId>
>                         <version>8.0.12</version>
>                         <scope>provided</scope>
>                 </dependency>
>                 <dependency>
>                         <groupId>javax.servlet</groupId>
>                         <artifactId>javax.servlet-api</artifactId>
>                         <version>3.1.0</version>
>                         <scope>provided</scope>
>                 </dependency>
>                 <dependency>
>                         <groupId>junit</groupId>
>                         <artifactId>junit</artifactId>
>                         <version>4.11</version>
>                         <scope>test</scope>
>                 </dependency>
>         </dependencies>
> </project>
>
> Hope someone can let me know how if I have missed out anything.
>
> Tks.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>