rampatel
rampatel

Reputation: 541

Issue regarding JSP Forward

In my code I am trying to forward my request by using below line

<jsp:forward page = "<%=request.getContextPath()%>/Welcome.do"/>

However its giving error below

org.apache.jasper.JasperException: /obajsp/OBAHeader.jsp(3,27) JBWEB004214: Error unquoting attribute value

Please someone help me to understand what is issue in my written code?

EDIT: this was currently working in production without any issue and giving issue in my local IDE

Upvotes: 0

Views: 927

Answers (3)

Raniere Soares
Raniere Soares

Reputation: 11

I'm working on a legacy project using a Wildfly 10.x and I faced the same problem with the same exception, occurring only in local IDE. The problem was fixed when added this to the VM Arguments in the Wildfly Launch Configuration window (in Eclipse IDE):

-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false

Upvotes: 0

Philipp Sander
Philipp Sander

Reputation: 10249

<jsp:forward page = "${pageContext.request.contextPath}/Welcome.do"/>

you dont need inline java to get the context path. expressionlanguage is much more comfortable.

Upvotes: 0

Stefan
Stefan

Reputation: 12462

Have you tried using the expression language, rather than a scriptlet?

<jsp:forward page = "${pageContext.request.contextPath}/Welcome.do"/>

Upvotes: 2

Related Questions