Discussion:
http status 404 - not found
Karen Goh
2018-11-18 04:01:35 UTC
Permalink
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-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Arjuna Bandara
2018-11-18 04:53:01 UTC
Permalink
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
Post by Karen Goh
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.
/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.
---------------------------------------------------------------------
Mark Thomas
2018-11-19 08:39:13 UTC
Permalink
Post by Karen Goh
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.
Post by Karen Goh
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.
Post by Karen Goh
Basically, I have created a maven structured web app and after right-click my tutorRegister page, and the form submitted, http status 404 appeared.
/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
Post by Karen Goh
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"
Post by Karen Goh
Here's my pom.xml ;
<snip/>
Post by Karen Goh
<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-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Salil Misra
2018-11-19 13:14:52 UTC
Permalink
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.
Post by Karen Goh
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.
/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.
---------------------------------------------------------------------
Karen Goh
2018-11-22 10:38:45 UTC
Permalink
--------------------------------------------
On Mon, 11/19/18, Salil Misra <***@gmail.com> wrote:

Subject: Re: http status 404 - not found
To: ***@tomcat.apache.org, ***@yahoo.com
Date: Monday, November 19, 2018, 9:14 PM

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

Loading...