You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Reynolds <ji...@gmail.com> on 2006/02/11 16:05:58 UTC

Site Setup, Need Advise On Struts Config

I have created a site <http://www.theuniquepear.com> using struts over
the past couple of months. I am running Tomcat 5x and Struts 1.2x.

But here is my huge problem. I have a html file in my tomcat root
which does a javascript function that directs the user to the site.
Soemthing like this:
top.location.href="http://www.theuniquepear.com/unique/index.jsp"

This gets the browser into the proper webapp from the url entered, and
it calls the index.jsp page which then calls a
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  <logic:forward name="welcome" />

The kind of defacto I see in all books.The welcome finally calls a
welcome.do action, I go and get some buisness objects, then finally
... display the jsp page that the end user sees.

This all works, except any web crawlers and robots, cannot follow this
insane logic. And when I do  a curl on my url, it only shows the
index.jsp with the javascript:

Is there a cleaner way to get around all this redirecting, so that I
can get my business logic called up and go to a clean page, so when I
do a curl which I think the robots are using, they can actually index
my site?

This is killing me. If anyone has ideas, suggestions, or could assist,
I would be appreciated.

Regards

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Site Setup, Need Advise On Struts Config

Posted by Mark Lowe <me...@gmail.com>.
Forward to your action with no javascript redirects....

<jsp:forward page="/welcome.do" />

redirecting rather than forwarding will lose some crawlers.

Another problem is if you use the html:img and or encode any paths to
images, css or other media things will get ugly for image crawlers and
such like, as the sessionid is appended to the path. This is also a
problem if users dont have cookies, in fact I'm unsure why html:img
doesn't just append the context path rather than fully encoding.

Mark

On 2/11/06, Jim Reynolds <ji...@gmail.com> wrote:
> I will give that a try. Thanks for the idea ... maybe that is all I
> need. I will implement the change and run some more curl.
>
> Many thanks,
>
> On 2/11/06, Torgeir Veimo <to...@pobox.com> wrote:
> > On Sat, 2006-02-11 at 09:10 -0600, Jim Reynolds wrote:
> > > Do you mean a redirect using a servlet or something like that?
> >
> > JSP:
> >
> > <%@ page contentType="text/html; charset=utf-8" %>
> > <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> >
> > <logic:redirect page="/publishing/section.do" />
> >
> > I'm not 100% sure, but I think robots follow redirects.
> >
> > --
> > Torgeir Veimo <to...@pobox.com>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Site Setup, Need Advise On Struts Config

Posted by Jim Reynolds <ji...@gmail.com>.
I will give that a try. Thanks for the idea ... maybe that is all I
need. I will implement the change and run some more curl.

Many thanks,

On 2/11/06, Torgeir Veimo <to...@pobox.com> wrote:
> On Sat, 2006-02-11 at 09:10 -0600, Jim Reynolds wrote:
> > Do you mean a redirect using a servlet or something like that?
>
> JSP:
>
> <%@ page contentType="text/html; charset=utf-8" %>
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
>
> <logic:redirect page="/publishing/section.do" />
>
> I'm not 100% sure, but I think robots follow redirects.
>
> --
> Torgeir Veimo <to...@pobox.com>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Site Setup, Need Advise On Struts Config

Posted by Torgeir Veimo <to...@pobox.com>.
On Sat, 2006-02-11 at 09:10 -0600, Jim Reynolds wrote:
> Do you mean a redirect using a servlet or something like that?

JSP: 

<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<logic:redirect page="/publishing/section.do" />

I'm not 100% sure, but I think robots follow redirects.

-- 
Torgeir Veimo <to...@pobox.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Site Setup, Need Advise On Struts Config

Posted by Jim Reynolds <ji...@gmail.com>.
Do you mean a redirect using a servlet or something like that?



On 2/11/06, Torgeir Veimo <to...@pobox.com> wrote:
> On Sat, 2006-02-11 at 09:05 -0600, Jim Reynolds wrote:
> > I have a html file in my tomcat root
> > which does a javascript function that directs the user to the site.
> > Soemthing like this:
> > top.location.href="http://www.theuniquepear.com/unique/index.jsp"
>
> Why don't you use a normal http redirect instead of using javascript?
>
> --
> Torgeir Veimo <to...@pobox.com>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Site Setup, Need Advise On Struts Config

Posted by Torgeir Veimo <to...@pobox.com>.
On Sat, 2006-02-11 at 09:05 -0600, Jim Reynolds wrote:
> I have a html file in my tomcat root
> which does a javascript function that directs the user to the site.
> Soemthing like this:
> top.location.href="http://www.theuniquepear.com/unique/index.jsp" 

Why don't you use a normal http redirect instead of using javascript?

-- 
Torgeir Veimo <to...@pobox.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org