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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to