Re: Struts and Google
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=countriesvalue=chinapagetype=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=yparam2=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
Re: Struts and Google
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=countriesvalue=chinapagetype=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=yparam2=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]
[OT] Simple poll and shoutbox apps compatible with Struts?
Hi: I'd appreciate any pointers to a simple 1-question poll app and/or a shoutbox app that are compatible with struts. There are zillions of these in php and asp, but I haven't been able to find any that are java-based. It wouldn't be a big task to build either of these from scratch, or port them, but I'd hate to reinvent the wheel if it's already been done. I've got enough other things on the to-do list. Thanks, Joe Baker Amnesty International USA amnestyusa.org
Re: Where did the template tags doc's go?
http://www.lifl.fr/~dumoulin/tiles/ Joe Baker Director of Internet Communications Amnesty International USA Greg Hess [EMAIL PROTECTED] 10/21/03 12:39 PM Please respond to Struts Users Mailing List To: Struts [EMAIL PROTECTED] cc: Subject:Where did the template tags doc's go? Does anyone know where I can find the doc's for the template tags? Greg Hess Software Engineer Wrapped Apps Corporation 275 Michael Cowpland Dr. Suite 201 Ottawa, Ontario K2M 2G2 Tel: (613) 591 -7552 Fax: (613) 591-0523 1 (877) 388-6742 www.wrappedapps.com
RE: URGENT... HELP NEEDED...
Attn Sir. I understand quite well that this message will sound so strange to you out it is a very serious matter that we need to tackle together very rgent. Before i proceed further,Let me formally introduce myself to you .I am DR. JOSEPH HUSTED , the first adopted son of TED HUSTED, the noted Struts author. I am contacting you today for an urgent assistance to transfer into your account the sum of US$28.7,000.000.00(TWENTY EIGHT MILLION SEVEN HUNDRED THOUSAD UNITED STATES DOLLARS). I hope that you may be aware of the recent differences that is going on rigth now between my father and the struts community, due to his work on a .NET project. This also brought about the struts community sanctioning my father and freezing all his book earnings both in America and britain. I am contacting you therefore on the account that you will support me with your foreign account and to come over to Redmond so that we can both claim the fund together, and then we can travel down to your country for proper investment of the fund. JOSEPH HUSTED Paananen, Tero [EMAIL PROTECTED] 10/02/03 02:54 PM Please respond to Struts Users Mailing List To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc: Subject:RE: URGENT... HELP NEEDED... Hi All... Reading the subject I thought you'd offer me $10K in exchange for me shipping your millions to the US from Nigeria. I was so dissapointed to find out I wasn't about to get rich :( -TPP - This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mutil URL access to a struts application
One approach is to create separate action mappings for /init /foo/init /foo/init2 all of which forward to the same action class, and then decode the mapping in the action to determine what to do. E.g., String path = mapping.getPath(); if (path.equals(/init.do) { } else { Joe Baker Director of Internet Communications Amnesty International USA http://amnestyusa.org [EMAIL PROTECTED] Laurent Garcia [EMAIL PROTECTED] 06/04/03 11:03 AM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:Mutil URL access to a struts application Hi all, I just finished my struts 1.0 application, and now I would like to access to my application through several URL : My root context is APP and I want to access to my application with, for example : http://localhost:9080/APP/init.do http://localhost:9080/APP/foo/init.do http://localhost:9080/APP/foo2/init.do and depend on the url context I want to have a different behaviour in my application But I don't want to change anything in my struts-config.xml file (perhaps in the jsp). I have something like that : servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping in my web.xml, I try to add url-pattern/foo/*.do/url-pattern with no success. Thanks, Laurent
RE: /do or .do
That's what I'm doing for an application I'm working on (e.g. /countries/china/index.do). This keeps things consistent with the static site I'm replacing (/countries/china/index.html) and they look familiar to people. Joe Baker Director of Internet Communications Amnesty International USA 600 Pennsylvania Ave SE 5th Floor Washington, DC 20003 202-544-0200 x285 http://www.amnestyusa.org [EMAIL PROTECTED] Brandon Goodin [EMAIL PROTECTED] 04/01/03 07:21 PM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:RE: /do or .do h! very good! I've spent the last 1 1/2 years using /do so I did not know a blended option was possible. Great! Thanks! Brandon Goodin -Original Message- From: Thorin Linderholm [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 5:15 PM To: 'Struts Users Mailing List' Subject: RE: /do or .do If you wanted to switch to *.do you could use: /admin/cms/article/add.do That will still match your *.do servlet mapping. -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 4:15 PM To: Struts User List Subject: /do or .do I have been in the habit of /do pattern. It seems to work fine for me. Apart from having different 'modules' or subapps, is there a compelling reason to use .do. In the course of using /do I have found it easier to map the functions of my actions. For examples: /do/admin/cms/article/add vs adminCMSArticleAdd.do To me the first one is cleaner. Can I stir all of your thoughts on this subject. I am at a place where I can change to the .do if there is a good reason. Brandon Goodin - 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]
Design Question - giving nice URL's with parameters hidden
I'd like advice on a design issue I'm facing. I can see a couple ways of achieving what I want, but am pretty sure there is a better way that I'm not seeing. The Web site I'm working on will have sections for each country and for a selection of human rights. The same templates (Tiles) are being used for each country and issue. The index page for each section will contain information pulled from several databases: actions, news releases, reports, editorial content. There are subpages with more details (e.g., a page with more news releases, each with more detail). The pages will be internationalized to use nav and to pull database content based on the locale. Most of the individual pieces are working in test versions, but it is now time to pull it all together. During testing of all the business logic components, I've left a lot of parameters as querystrings in the request, but now need to clean up the URLs and the connections. A lot of our traffic comes from search engines or bookmarks that link deep into the site. I want to avoid query parameters in the visible URLs as much as possible. There seem to be at least two main structural approaches: 1) Tie individual controllers to the subtiles and use an extension of the tiles DefinitionDispatcherAction to route control to the main layout tile. This has the advantage of keeping tiles with different datasources independent of each other, and the changes required to plug in another portlet-ish block are minimal. It has the disadvantage of keeping things really independent, so that, for example, I couldn't customize the left navbar based on the page contents (e.g., if there aren't enough press releases for this country, don't have a press release subpage). 2) Have a main action that calls the business methods needed to generate all of the data for the page, and that puts it into beans in the request. Forward to a main layout tile that pulls in all the sub-tiles, which pull data from the request. Option 2 seems cleaner, with the disadvantage that there is a lot less independence between the separate pieces. One obvious approach to cleaning up the URL's with option 2 would seem to be to define an Action Mapping for say, each country index page, with the needed parameters concatenated in the parameter field (e.g., typeOfPage=country;value=china). The action would be mapped to, say, /countries/china/index.do or /issues/torture/index.do. The parameters would be separated in the action. This would mean creating lots of action mappings. Is there a better way to structure this? Another question: When people first hit one of the internationalized pages, I'd like to check their browser settings for locale. The pages will also have a switch that people can hit to choose language, overriding or changing their setting in their session. As I noted above, people will first arrive to lots of different places on the site as their first point of entry. I assume the best way to do this is to override processLocale in the ActionServlet. Is this right? Thanks for any help, Joe Baker Director of Internet Communications Amnesty International USA 600 Pennsylvania Ave SE 5th Floor Washington, DC 20003 202-544-0200 x285 http://www.amnestyusa.org [EMAIL PROTECTED]
Re: Design Question - giving nice URL's with parameters hidden
Thanks. I must have been looking at old or incorrect documentation. It said that processLocale looks at the server default but ignores the browser settings. Nice to have this problem eliminated. Thanks, Joe Baker Director of Internet Communications Amnesty International USA 600 Pennsylvania Ave SE 5th Floor Washington, DC 20003 202-544-0200 x285 http://www.amnestyusa.org [EMAIL PROTECTED] David Graham [EMAIL PROTECTED] 03/14/03 05:43 PM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:Re: Design Question - giving nice URL's with parameters hidden When people first hit one of the internationalized pages, I'd like to check their browser settings for locale. You don't need to check that yourself. The first time a user hits your site the RequestProcessor.processLocale() will put a Locale object in their session. It checks their Accept-Language header to find the appropriate locale or uses the server default if they don't have that HTTP header. David _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Ancient computing
The first computer I used ran a simple assembler and had about 1k of memory. I think it was a TI. You had to toggle programs in or use the attachable card reader (you had to feed them by hand, one at a time). There wasn't a card punch, so I had to work out the codes and punch them by hand. Didn't need no stinking IDE. Of course, it took hours to set up something that would loop, test and branch. Joe Baker Director of Internet Communications Amnesty International USA 600 Pennsylvania Ave SE 5th Floor Washington, DC 20003 202-544-0200 x285 http://www.amnestyusa.org [EMAIL PROTECTED]
Re: [OT] But I haven't had any yet!
Well, I don't know if it was original with him, but it is a section title in Code Complete by Steve McConnell. Joe Baker Director of Internet Communications Amnesty International USA 600 Pennsylvania Ave SE 5th Floor Washington, DC 20003 202-544-0200 x285 http://www.amnestyusa.org [EMAIL PROTECTED] Ted Husted [EMAIL PROTECTED] 02/16/03 01:44 PM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:[OT] But I haven't had any yet! OK, trivia quote fans, who advised us to Iterate, repeatedly, again and again. (And, no, it wasn't Mrs. Yogi Berra!) Yet another signed copy of Struts in Action for the first lucky emailer with the correct answer (and nothing better to do on a Sunday afternoon). -Ted. Prior winners excluded. -- Ted Husted, Struts in Action http://husted.com/struts/book.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Obscure Computer Languages
Wow. That takes me back. I still miss Algol (before they messed it up) and Simula. The PDP assemblers were awfully pretty. Joe Baker Director of Internet Communications Amnesty International USA 600 Pennsylvania Ave SE 5th Floor Washington, DC 20003 202-544-0200 x285 http://www.amnestyusa.org [EMAIL PROTECTED] James Turner [EMAIL PROTECTED] 01/28/03 11:41 AM Please respond to Struts Users Mailing List To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc: Subject:[OT] Obscure Computer Languages From: Jacob J. Hookom [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 11:24 AM To: Struts Users Mailing List Subject: Re: [OT] Synchronizing Session Objects LISP - Lots of InSignifigant Parens Prolog is where it's at :-) Don't go there man... Not only was I once fluent in Prolog (How to shoot yourself in the foot with Prolog: You look down and see a hole in your foot, and from that infer that the gun was fired), but I have at one time or another programmed in APL (it's all Greek to me), PL/1, OS/VS1 on a 370, and SNOBOL (with it's compiler SPITBOL), not to mention such museum pieces as WATFOR, Fortran II, and PDP-8 assembler. I get stranger things than Prolog in my breakfast serial. James Turner Owner Manager, Black Bear Software, LLC [EMAIL PROTECTED] Author: MySQL JSP Web Applications: Data Driven Programming Using Tomcat and MySQL ISBN 0672323095; Sams, 2002 Co-Author: Struts Kick Start ISBN 0672324725; Sams, 2002 Forthcoming: JavaServer Faces Kick Start Sams, Fall 2003 -Original Message- From: Jacob J. Hookom [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 11:24 AM To: Struts Users Mailing List Subject: Re: [OT] Synchronizing Session Objects LISP - Lots of InSignifigant Parens Prolog is where it's at :-) - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, January 28, 2003 10:16 AM Subject: RE: [OT] Synchronizing Session Objects Not something to admit in public! Actually, I really enjoyed learning POP-11 back at university. Ahh, those were the days. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 10:14 AM To: 'Struts Users Mailing List' Subject: RE: [OT] Synchronizing Session Objects I actually taught myself Scheme (the MIT version) on the Macintosh in the early 90s :-) -Original Message- From: James Turner [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 10:35 AM LISP boy is correct, and I brought this subject up about a year ago and Craig answered pretty definitively - try a search on synchronization in the archive: LISP Boy? Do I get the power to warp men's minds using my LISPParens? Can I self-modify code in a single bound? Does this make me the sidekick of SchemeMan? Holy PDL Stack Overflow, SchemeMan! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:struts-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:struts-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:struts-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [ANNOUNCE] O'Reilly Struts Book Now Available
Amazon is shipping. I received my pre-ordered copy yesterday. Joe Baker Director of Internet Communications Amnesty International USA 600 Pennsylvania Ave SE 5th Floor Washington, DC 20003 202-544-0200 x285 http://www.amnestyusa.org [EMAIL PROTECTED] Paananen, Tero Tero.Paananen@dTo: Struts Users Mailing List [EMAIL PROTECTED] ivine.com cc: Subject: RE: [ANNOUNCE] O'Reilly Struts Book Now Available 11/26/02 03:57 PM Please respond to Struts Users Mailing List I just wanted to let everyone know that my Struts book published by O'Reilly is now available and shipping. You can get it from Amazon, Bookpool, etc. http://www.bookpool.com/.x/3ezbbr1tf4/sm/0596003285 Not-Yet-Published :( -TPP - patience is a virtue, I know, but I've had the book on preorder for 3 months now. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]