Erik,

The getServletPath () returns the whole path to the servlet. As far as
I know, there's no method that returns exactly what you need ,so you'll
need to do the parsing (remove what is after the last "/") by yourself.
Perhaps using scriptlet (nasty but will work).

<c:set var="path">
        <% ... the code .. %>
</c:set>

You could also have you action prepare this path variable and put it on
the request scope.

Erez

-----Original Message-----
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 20, 2004 10:38 PM
To: Struts Users Mailing List
Subject: Re: Tag question

Hmm actually that renders everything *after* the servlet path, oddly.

My controller is mapped to /services/*.

I need a var that is equal to "/services".

The example below is printing out the end of the path --
"/usecase/page.jsp"

Erik

Erez Efrati wrote:

>Try the following:
>
><c:set var="thePath" value="${pageContext.request.servletPath}" />
>
>Regards,
>
>Erez
>
>
>-----Original Message-----
>From: Erik Weber [mailto:[EMAIL PROTECTED] 
>Sent: Tuesday, July 20, 2004 10:21 PM
>To: Struts Users Mailing List
>Subject: Tag question
>
>How can I set a variable (I assume with c:set) that will hold the value

>of request.getServletPath, so that I can use it in el tags?
>
>Thanks,
>Erik
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to