问题描述:

I am using following code but getting error .

<c:set var="temp1" value="${variableVal}" />

<c:url var="urlVar" value="Testing.jsp">

<c:param name = "DisParam" value ="${temp1}"/>

</c:url>

<TD ><a class="Tabs" href="<c:url value="${urlVar}"/>">Testing</a>|</TD>

but I am getting following error

Error Message: java.io.FileNotFoundException: SRVE0190E: File not

found: /${urlVar} Error Code: 404 Target Servlet:

com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor Error

Stack: java.io.FileNotFoundException: SRVE0190E: File not found:

/${urlVar}

I am using websphere version 8.0

How can I resolve this?

网友答案:

So things are looking good here:

<c:set var="temp1" value="${variableVal}" />
<c:url var="urlVar" value="Testing.jsp">
    <c:param name = "DisParam" value ="${temp1}"/>
</c:url>        

but instead of using the "urlVar" var that you created, you are using c:url to re-encode the contents of "urlVar". You don't want to do that. So replace:

<a class="Tabs" href="<c:url value="${urlVar}"/>">Testing</a>

with

<a class="Tabs" href="${urlVar}">Testing</a>

because urlVar should already be a nicely encoded URL with a parameter called "DisParam".

Note: You could get rid of the first line:

<c:url var="urlVar" value="Testing.jsp">
    <c:param name="DisParam" value="${variableVal}"/>
</c:url>        
<TD><a class="Tabs" href="${urlVar}">Testing</a>|</TD>
相关阅读:
Top