You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by Jerry Atrick <jj...@gmail.com> on 2008/07/28 23:45:04 UTC

tomcat auth incorrectly redirects to img

When attempting to log into a standard form-based login field, I'm always
redirected to an image folder.

My folder layout:
/img
/web-inf/
/web-inf/web.xml
/web-inf/defn/tiles-defn.xml
/web-inf/tiles/header.jsp
/index.jsp
/login.jsp
/error.jsp

setup:
Spring2.5/tiles2/tomcat5.5

The web.xml stuff is pretty standard stuff.

my root template is defines as

[code]
<title>
    <tiles:getAsString name="title"/>
</title>
</head>
<body>

<div id="header">
    <div id="logo"><img src="<c:url value="/img/logo1.gif" />" /></div>

    <div>
        <div id="headertitle">
            <tiles:insertAttribute name="header"/>
        </div>


        <div id="headermenu">
            <tiles:insertAttribute name="headernav"/>
        </div>
    </div>
</div>
{/code]

and all my tiles defn are as such:

[code]
    <definition name="first.layout"
template="/WEB-INF/jsp/template/layout.jsp">
        <put-attribute name="title" value="etc"/>
        <put-attribute name="header" value="asdf"/>
    </definition>
[/code]

What happens:
1. I attempt to go to a url
2. It properly stops me and asks me to login
3. I enter user credentials and hit login
4. It sucessfully logins.
5. It redirects me to /img/myimage.gif

every time.

I know that the login works fine, as when I fix my url to the url i was
originally at, everything is correctly authenticated. Is there a way to set
a default url when you attempt to login?

Anyone else get a similar problem before?

Specifically, it seems that whenever it gets to this line:

<div id="logo"><img src="<c:url value="/img/logo1.gif" />" /></div>

it redirects to the image instead of simply outputting it. The even odder
thing is that, when I go back to the proper view, (ie: localhost:8080/myapp)
the layout renders correctly. Is there some issue with tiles not correctly
redirecting images?


Any help would be a life saver.

Re: tomcat auth incorrectly redirects to img

Posted by Antonio Petrelli <an...@gmail.com>.
This question is not related to Tiles, why do you ask it here?
Possibly you have to ask the Tomcat Users mailing list:
http://tomcat.apache.org/lists.html

Antonio

2008/7/28 Jerry Atrick <jj...@gmail.com>:
> When attempting to log into a standard form-based login field, I'm always
> redirected to an image folder.
>
> My folder layout:
> /img
> /web-inf/
> /web-inf/web.xml
> /web-inf/defn/tiles-defn.xml
> /web-inf/tiles/header.jsp
> /index.jsp
> /login.jsp
> /error.jsp
>
> setup:
> Spring2.5/tiles2/tomcat5.5
>
> The web.xml stuff is pretty standard stuff.
>
> my root template is defines as
>
> [code]
> <title>
>    <tiles:getAsString name="title"/>
> </title>
> </head>
> <body>
>
> <div id="header">
>    <div id="logo"><img src="<c:url value="/img/logo1.gif" />" /></div>
>
>    <div>
>        <div id="headertitle">
>            <tiles:insertAttribute name="header"/>
>        </div>
>
>
>        <div id="headermenu">
>            <tiles:insertAttribute name="headernav"/>
>        </div>
>    </div>
> </div>
> {/code]
>
> and all my tiles defn are as such:
>
> [code]
>    <definition name="first.layout"
> template="/WEB-INF/jsp/template/layout.jsp">
>        <put-attribute name="title" value="etc"/>
>        <put-attribute name="header" value="asdf"/>
>    </definition>
> [/code]
>
> What happens:
> 1. I attempt to go to a url
> 2. It properly stops me and asks me to login
> 3. I enter user credentials and hit login
> 4. It sucessfully logins.
> 5. It redirects me to /img/myimage.gif
>
> every time.
>
> I know that the login works fine, as when I fix my url to the url i was
> originally at, everything is correctly authenticated. Is there a way to set
> a default url when you attempt to login?
>
> Anyone else get a similar problem before?
>
> Specifically, it seems that whenever it gets to this line:
>
> <div id="logo"><img src="<c:url value="/img/logo1.gif" />" /></div>
>
> it redirects to the image instead of simply outputting it. The even odder
> thing is that, when I go back to the proper view, (ie: localhost:8080/myapp)
> the layout renders correctly. Is there some issue with tiles not correctly
> redirecting images?
>
>
> Any help would be a life saver.
>