Thanks for the reply Joe, lot's of help and makes things clearer.
Brian
From: [EMAIL PROTECTED] Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Subject: Re: Struts and Google Date: Sat, 20 Dec 2003 10:55:28 -0500
Hi Brian:
The main thing driving this approach wasn't so much supporting search engines, it was having user-friendly URLs and to match an already-existing site structure. There is one action that generates index and subpages for about 200 countries as well as sections on a bunch of human rights issues. There is an action mapping for each subpage. I've got an XML file with the information for each country (the 'directory' name, the English and Spanish names, how that country is selected in different legacy databases). A little java routine generates all the action mappings (I run it from the ant build process) and stores them in a file that is pulled into the main struts-config file. The action mappings look like:
<action path="/countries/afghanistan/index" type="org.amnestyusa.topics.TopicAction"> <forward name="success" path="topic.index"/> </action> <action path="/countries/afghanistan/summary" type="org.amnestyusa.topics.TopicAction"> <forward name="success" path="topic.summary"/> </action> <action path="/countries/afghanistan/reports" type="org.amnestyusa.topics.TopicAction"> <forward name="success" path="topic.reports"/> </action> <action path="/countries/afghanistan/document" type="org.amnestyusa.topics.TopicAction"> <forward name="success" path="topic.document"/> </action> <action path="/spanish/countries/afghanistan/index" type="org.amnestyusa.topics.TopicAction"> <forward name="success" path="topic.index"/> </action> <action path="/spanish/countries/afghanistan/summary" type="org.amnestyusa.topics.TopicAction"> <forward name="success" path="topic.summary"/> </action> .... <action path="/countries/zimbabwe/index" type="org.amnestyusa.topics.TopicAction"> <forward name="success" path="topic.index"/> </action> ... <action path="/child_soldiers/index" type="org.amnestyusa.topics.TopicAction"> <forward name="success" path="issue.index"/> </action> <action path="/child_soldiers/summary" type="org.amnestyusa.topics.TopicAction"> <forward name="success" path="issue.summary"/> </action>
TopicAction decodes the action path, gathers the appropriate information from several business methods, puts the appropriate beans in the request, and forwards to a tile. The pages support English and Spanish, based on browser default or user selection, but if the action starts with "/spanish", the output is forced to Spanish, regardless of the session settings (this matches existing site structure). For pages that require additional parameters (for example, displaying a document) I'm just passing a standard request parameter (e.g., with the document id).
I'd guess there are better ways to do this (I'm not a real web developer, but have been forced into trying to pull things together), but it has been working pretty well for our needs, where our departments want easy-to-understand URLs that go directly to their sections of the website.
Joe Baker Director of Internet Communications Amnesty International USA http://amnestyusa.org
"Brian Styles" <[EMAIL PROTECTED]> 12/19/03 11:24 AM Please respond to "Struts Users Mailing List"
To: [EMAIL PROTECTED] cc: Subject: Re: Struts and Google
Hey Joe, thanks for the help.
I'm a little unsure of exactly how you do this with regards to the struts-config file and path parameters. Could you give me an example? Is it something like this?
<action path="/countries/china/ type="com.whatever.ChinaAction" name="chinaForm" scope="request" unknown="false" validate="false" >
And also, how do you handle more parameters that you might want to pass to
the page?
thanks very much, Brian
>From: [EMAIL PROTECTED] >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]> >Subject: Re: Struts and Google >Date: Fri, 19 Dec 2003 10:14:59 -0500 > >I think the main search engine problems come up when there are lots of >parameters in the URL, although Google seems to do pretty well. One >solution is to turn what would have been parameter names into 'directory' >names in the URL. For example, on my site, rather than have a url like: >http://amnestyusa.org/exe.do?method=countries&value=china&pagetype=index >I have action mappings of the form: >/countries/china/index.do >that all go to the same basic action. The action then decodes what to do >from the URL. In a lot of ways this is similar in effect to what the >rewrite engine in Apache can do (turning /x/y/z into >/cgi-bin/x.cgi?param1=y¶m2=z ). > >I'm sure there is a better way, but this has been working pretty well. >Along with helping some search engines, it gives users urls that are much >easier to remember. > >Joe Baker >Amnesty International USA > > > > > >"Brian Styles" <[EMAIL PROTECTED]> >12/19/03 09:56 AM >Please respond to "Struts Users Mailing List" > > > To: [EMAIL PROTECTED] > cc: > Subject: Struts and Google > > >Hi all, > >I've searched the archives on this topic, but would appreciate any up to >date advice. I have my actions forwarding to my jsps in my WEB-INF folder. > >Thus my jsps are protected from direct access. However I obviously want my > >site to get as high a rating on google and other search engines as >possible. >Now I have heard differing reports that google can list dynamic sites and >also that it cannot. I would very much like to know people's experience >with >this. > >If the answer is that google cannot crawl a struts site like this, then >I'd >very much appreciate user's previous approaches to this problem. > >thanks very much, >Brian > >_________________________________________________________________ >MSN 8 with e-mail virus protection service: 2 months FREE* >http://join.msn.com/?page=features/virus > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > >
_________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]