In a JSP page(index.jsp):
${requestContext.requestURL} is the URL
just shows the expression itself. It used to be evaluated to something like ‘http://…/somerset/‘
I created the Maven project with maven-archetype-webapp archetype in Eclipse. The Jetty version is jetty-6.1.14.
My web.xml is simple:
<web-app> <display-name>Archetype Created Web Application</display-name> <servlet> <servlet-name>SomersetServlet</servlet-name> <display-name>SomersetServlet</display-name> <description></description> <servlet-class>com.foo.somerset.SomersetServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>SomersetServlet</servlet-name> <url-pattern>/som.do</url-pattern> </servlet-mapping> </web-app>
See Javascript String.replace(/\$/,str) works weirdly in jsp file for some possible reasons.
Your web.xml should contain reference to web-app_2_4.xsd schema, like
This enables servlet 2.4 and jsp 2.0 processing, which includes EL.
Btw
requestContextis not valid implicit object.