Quantcast

Struts 2 - Namespaces and hiding JSPs in WEB-INF

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Struts 2 - Namespaces and hiding JSPs in WEB-INF

Jim Kiley
Hey gang,

I'm doing something that appears to be a bit strange and I'd appreciate any
advice anyone might have.

I have two areas within my app -- "admin" and "user".  So I have <package
name="user" namespace="/user"> and <package name="admin"
namespace="/admin">.  That seems simple enough.

The problem I'm running into stems from an earlier decision to "hide" my
JSPs within /WEB-INF/.  So I have, for instance, (greatly truncated),

<package name="user" extends="struts-default" namespace="/user">
<action name="index">
<result>/WEB-INF/jsp/index.jsp</result>
</action>
</package>

Well -- this innocuous bit of code throws a 404, because the Dispatcher
appears to be looking under myapp/user/WEB-INF/jsp/index.jsp.  Obviously it
ain't there.  But I can't persuade the Struts to use a different context
root than /user to hunt for the JSPs.

Any suggestions as to how I can work around this problem without yanking all
my JSPs up and out of WEB-INF?

--
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Struts 2 - Namespaces and hiding JSPs in WEB-INF

Jim Kiley
False alarm, please ignore.  Sheesh.

On Fri, May 16, 2008 at 2:50 PM, Jim Kiley <[hidden email]> wrote:

> Hey gang,
>
> I'm doing something that appears to be a bit strange and I'd appreciate any
> advice anyone might have.
>
> I have two areas within my app -- "admin" and "user".  So I have <package
> name="user" namespace="/user"> and <package name="admin"
> namespace="/admin">.  That seems simple enough.
>
> The problem I'm running into stems from an earlier decision to "hide" my
> JSPs within /WEB-INF/.  So I have, for instance, (greatly truncated),
>
> <package name="user" extends="struts-default" namespace="/user">
> <action name="index">
> <result>/WEB-INF/jsp/index.jsp</result>
> </action>
> </package>
>
> Well -- this innocuous bit of code throws a 404, because the Dispatcher
> appears to be looking under myapp/user/WEB-INF/jsp/index.jsp.  Obviously it
> ain't there.  But I can't persuade the Struts to use a different context
> root than /user to hunt for the JSPs.
>
> Any suggestions as to how I can work around this problem without yanking
> all my JSPs up and out of WEB-INF?
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com




--
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Struts 2 - Namespaces and hiding JSPs in WEB-INF

Mead Lai
<result name="login">/WEB-INF/web/user/login.jsp</result>
My app config like that. It's ok.
Haven't get this problem.

On Sat, May 17, 2008 at 3:59 AM, Jim Kiley <[hidden email]> wrote:

> False alarm, please ignore.  Sheesh.
>
> On Fri, May 16, 2008 at 2:50 PM, Jim Kiley <[hidden email]> wrote:
>
>> Hey gang,
>>
>> I'm doing something that appears to be a bit strange and I'd appreciate any
>> advice anyone might have.
>>
>> I have two areas within my app -- "admin" and "user".  So I have <package
>> name="user" namespace="/user"> and <package name="admin"
>> namespace="/admin">.  That seems simple enough.
>>
>> The problem I'm running into stems from an earlier decision to "hide" my
>> JSPs within /WEB-INF/.  So I have, for instance, (greatly truncated),
>>
>> <package name="user" extends="struts-default" namespace="/user">
>> <action name="index">
>> <result>/WEB-INF/jsp/index.jsp</result>
>> </action>
>> </package>
>>
>> Well -- this innocuous bit of code throws a 404, because the Dispatcher
>> appears to be looking under myapp/user/WEB-INF/jsp/index.jsp.  Obviously it
>> ain't there.  But I can't persuade the Struts to use a different context
>> root than /user to hunt for the JSPs.
>>
>> Any suggestions as to how I can work around this problem without yanking
>> all my JSPs up and out of WEB-INF?
>>
>> --
>> Jim Kiley
>> Technical Consultant | Summa
>> [p] 412.258.3346 [m] 412.445.1729
>> http://www.summa-tech.com
>
>
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...