Re: reloading issue
It is possible to reload the struts-config file: http://localhost:8080/myApp/admin/reload.do (to be able to do that the reload action must be declared in struts-config) Jean-Noel - Original Message - From: Ali Ozoren <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 20, 2001 10:14 AM Subject: reloading issue > Hi all, I'm new in this list so please be patient. I looked into docs and > mail archives, and deja but couldn't find a solution to the problem. Every > time I make a chance in the formbean, action, jsp, or the strut-config.xml > file, I have to stop and restart Tomcat. Is this necessary (if yes, dang!), > if not how can I correct this (making every change not requiring restarting > Tomcat)? > Thanks > --a >
Re: Performance of struts
You have forgoten www.jboss.org an open source ejb container, it is release with tomcat. Eric Brown a écrit : > I haven't done any comparisons recently, but I think Resin from > www.caucho.com is very reasonably priced and written specifically with > performance in mind (from what I can tell). I've written a Java based http > proxy server before and I can tell you that from looking at some of the > things Resin has done, they know where Java's performance bottlenecks are. > (For example, they translate all socket streams into byte arrays instead of > using strings, etc.) They have some performance comparisons on their web > site. > > Others are: > Orion - Know nothing about > BEA WebLogic - Very expensive, complex to deploy and performance is mediocre > according to my sources > ATG Dynamo - Expensive but good for commerce if needed. They are focused on > commerce, so probably not focused on performance. > Netscape/iPlanet - I've heard the performance is not impressive > IBM WebSphere - This is an up-and-coming competitor to WebLogic and ATG. It > used to be buggy and is still expensive. Performance is unknown, but I would > favor Resin as it comes with source and is less expensive. > Jrun - Priced reasonably. Nice integration with other Allaire products. No > special commerce features. I think it has had some compatibility problems, > but it seems a good engine these days. All the same, I don't think you can > get source and I haven't done performance tests. > Enhydra - This is just Tomcat. They have their own framework that is less > comprehensive than struts called XMLC. Its big advantage is that it does a > better job of separating UI from code. > > I think to some degree, it is equally important to look at the JVM you are > running on. Consider looking at the Volano report at > http://www.volano.com/report.html. > > My team is using Tomcat/Forte for development and will use Resin/Apache for > deployment. > > Eric > > -Original Message- > From: James Howe [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 19, 2001 2:16 PM > To: [EMAIL PROTECTED] > Subject: Re: Performance of struts > > If Tomcat's performance is pretty awful, what are some JSP implementations > (commercial or otherwise) that are particularly good? > > At 12:10 PM 3/19/2001 -0800, you wrote: > > >Struts based apps (or any app that uses custom tags heavily) are going to > >be significantly impacted by the quality of the JSP implementation in your > >container. Which version are you using? (NOTE: Tomcat's performance > >w.r.t. JSP pages is pretty awful, for example). > > > > > Thanks! > > > keith > > > > > > > > > > > > >Craig McClanahan > > James W. Howe mailto:[EMAIL PROTECTED] > Allen Creek Software, Inc. pgpkey: > http://ic.net/~jwh/pgpkey.html > Ann Arbor, MI 48103
struts tags
Hi, Can anybody help me as soon as possible with the following questions : 1. Readonly text field : How do I create a readonly input text form field, using the struts tag "html:text" ? A standard html tag can have the readonly attribute set, but this does not seem to exist for the corresponding struts tag "html:text". 2. Populating beans : Using struts html tags, a form field is coupled to a bean property. When only "property" is specified, the field is coupled to a property of the corresponding form bean. When "name" and "property" are specified, the field can be coupled to a property of another bean. However, when the form is submitted, the form field value will only be put automatically into the corresponding property in case of using a form bean. In case of using another bean than a form bean, the property is not set automatically (I have to populate this other bean myself). That means that the coupling of form fields to other beans than form beans only works in the get-direction (properties are consulted for rendering the form fields), not in the set-direction. Why this asymmetrical behaviour ? 3. Sometimes I need form fields with a name, to be used by JavaScript, but without coupling them to a bean property. Hence I created form fields with a "property" specified, which does not exist in the form bean. I would expect that this should work, not setting any (non existent) property in the form bean. But I get : javax.servlet.ServletException: runtime failure in custom tag 'form' H. Franken, software engineer at Agfa n.v.
Re:html:link and ssl
Hallo, I am sending my mail again, because I am thinking that the struts mailing list have not get this mail. (I got it not back) I hope, that this is o.k.. here is my example: struts-config: .. .. an now I want to use in every page something like this: .. login .. I don't want to switch from ssl to non-ssl. I am using the whole time ssl. But the link wouldn't be create. Example for testing page: <%=pageContext.getRequest().getScheme() %> <%=pageContext.getRequest().getServerName() %> <%=pageContext.getRequest().getServerPort() %> <%=((HttpServletRequest)pageContext.getRequest()).getContextPath() %> <%java.net.URL url = new java.net.URL(request.getScheme(), request.getServerName(), request.getServerPort(), request.getContextPath());%> <%=url.toString()%> index When I request this page with: {HYPERLINK "http://myserver/mycontext/index.jsp"} http://myserver/mycontext/index.jsp I get back: http myserver 80 /mycontext {HYPERLINK "http://myserver/mycontext"}http://myserver/mycontext login (as link) When I request this page with: {HYPERLINK "https://myserver/mycontext/index.jsp"}https://myserver/mycontext/index.jsp I get back: Exception: java.net.MalformedURLException: unknown protocol: https at java.net.URL.(URL.java:307) at java.net.URL.(URL.java:224) I hope this will explame my problem in more details. Harald On 19 Mar 2001, at 9:24, Craig R. McClanahan wrote: > > > On Mon, 19 Mar 2001 [EMAIL PROTECTED] wrote: > > > Hallo, > > > > I have some problems with the struts html-tag link with the > > properties forward or page. I want to use this tag with ssl. It doesn't > > create the link, because the method in > > org.apache.struts.util.RequestUtils throws in the method > > absoluteURL a MalformedURLException because unknown > > protocol. > > Do I need some additional package for ssl? Or is there a other > > solution? > > > > Could you give an example of how you are trying to do this? > > Note that trying to use the "page" attribute only works within the current > web application (the path you give it is context-relative beginning with a > "/"). To go to a different web application, or to switch from SSL to > non-SSL or back, you will need to make sure you generate a redirection, > either by using the "href" attribute, or by referencing a > element that has redirect="true" on it. > > > Thanks for help > > > > Harald > > > > Craig > >
Re: reloading issue
Additional info: if you recompile FormBean, Action, then copy a new *class file under appropriate tomcat directory. It will be reloaded automatically (if you do not change Tomcat configuration). The same is true for JSP files. Jean-Noel Ribette wrote: > It is possible to reload the struts-config file: >http://localhost:8080/myApp/admin/reload.do > > (to be able to do that the reload action must be declared in struts-config) > > Jean-Noel > > - Original Message - > From: Ali Ozoren <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, March 20, 2001 10:14 AM > Subject: reloading issue > > > Hi all, I'm new in this list so please be patient. I looked into docs and > > mail archives, and deja but couldn't find a solution to the problem. Every > > time I make a chance in the formbean, action, jsp, or the strut-config.xml > > file, I have to stop and restart Tomcat. Is this necessary (if yes, dang!), > > if not how can I correct this (making every change not requiring restarting > > Tomcat)? > > Thanks > > --a > >
Re: strange html:form tag
Yuan Jun wrote: > > i download jakarta-struts-1.0-b1 today and found next in registration.jsp > > > > > > should it be: > Either would be correct. The '.do' has been optional since the last week in January, maybe before. > or i've missed something? > > John. -Rob
RE: strange html:form tag
What does that mean? How do you set up your servlet mapping in web.xml then? -Original Message- From: Rob Leland [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 6:39 AM To: [EMAIL PROTECTED] Subject: Re: strange html:form tag Yuan Jun wrote: > > i download jakarta-struts-1.0-b1 today and found next in registration.jsp > > > > > > should it be: > Either would be correct. The '.do' has been optional since the last week in January, maybe before. > or i've missed something? > > John. -Rob
Re: Locales and images
Craig, Can I ask you on an example to be sure, that it is correct. My images are under images directory from root application dir. So, I can put the following statements: (in a property file : message.key=images a.image=a.gif a.image.dir=images/a.gif ) ... ... Can I put a.gif into the property file too, and have the second statement as this: Or I can have Thanks, Maya "Craig R. McClanahan" wrote: > There was a recent addition to the and tags to > support internationalized images elegantly. > > Previously, you had to use the "src" attribute to specify the URI of your > image. If you needed different images for each language, you had to use a > scriptlet expression of some sort to calculate them. > > Now, you can specify a message key (to be looked up in your application > resources) instead: > > > > where "message.key" identifies the path to this image from your > application resources. > > If you want to use context-relative paths everywhere, use: > > > > instead. > > > > Craig
Re: Locales and images
I'm struggling with something very similar and could really use a recommendation. In the Building View Components documentation about i18n, (http://jakarta.apache.org/struts/userGuide/building_view.html), it describes using a MyResources.properties (default) and other MyResources_XX.properties for other languages. This uses the "application" init-param of the ActionServlet in web.xml. That's fine and dandy for a small application, but for a large JSP application, I don't think I want to maintain *all* my i18n text (including images!) in a single file per language. I'm thinking the best way to break this up is to put some "common" text in a file like CommonResources.properties. Put my images in a file like ImageResources.properties. And finally put text that is unique to each JSP file in their own properties files (for example Foo.jsp -> FooResources.properties, Bar.jsp -> BarResources.properties, etc.) - and I realize that for each language, I'd need a BarResources_DE.properties for example, but that's okay. I think that each of these ResourceBundle's needs to be put under their own application scoped bean/key, i.e. imageresource -> com.mycompany.mypackage.ImageResources. Question is, is this the right approach? If so, how do I do this? I think I use ... bundle="fooresource" via each struts tag, (i.e. ) And I'd have to load that in advance via each controller servlet (or should I extend org.apache.struts.action.ActionServlet and load them all there). Is this all correct? A pointer to an example would help me greatly. Thanks, Ken Maya Muchnik wrote: > Craig, > > Can I ask you on an example to be sure, that it is correct. > My images are under images directory from root application dir. So, I can put the > following statements: > (in a property file : > message.key=images > a.image=a.gif > a.image.dir=images/a.gif > ) > > > ... > > ... > > Can I put a.gif into the property file too, and have the second statement as > this: > > Or I can have > > > Thanks, > > Maya > > "Craig R. McClanahan" wrote: > > > There was a recent addition to the and tags to > > support internationalized images elegantly. > > > > Previously, you had to use the "src" attribute to specify the URI of your > > image. If you needed different images for each language, you had to use a > > scriptlet expression of some sort to calculate them. > > > > Now, you can specify a message key (to be looked up in your application > > resources) instead: > > > > > > > > where "message.key" identifies the path to this image from your > > application resources. > > > > If you want to use context-relative paths everywhere, use: > > > > > > > > instead. > > > > > > > > Craig -- Ken Beyer Metatec Internet Products Group [EMAIL PROTECTED] | http://www.metatec.com/ "The box said 'Requires Windows 95 or better.' - so I installed Linux."
Re: Any good example?
struts-example is the best known open example how to use struts. If you know it with all details - you are in good "shape". Any form extends ActionForm. When you will design your application you will start with forms design, beans corresponding to them and so on... See Yam Lim wrote: Hey guys, i am new to Struts. i try to speed up my learning here. could anybody show me a good example? i already got the examples that come with Struts. Can anyone also tell me what role ActionForm plays in Struts? Thanks. See-Yam Lim
Re: strange html:form tag
Then struts html:form tag is processed if the action name does not have a .do at the end, one will be appended so when it is sent out to the browser it will always see a 'XXX.do' present. Troy Hart wrote: > > What does that mean? How do you set up your servlet mapping in web.xml then? > > -Original Message- > From: Rob Leland [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 20, 2001 6:39 AM > To: [EMAIL PROTECTED] > Subject: Re: strange html:form tag > > Yuan Jun wrote: > > > > i download jakarta-struts-1.0-b1 today and found next in registration.jsp > > > > > > > > > > > > should it be: > > > > Either would be correct. > > The '.do' has been optional since the last week > in January, maybe before. > > > or i've missed something? > > > > John. > > -Rob
Any good example?
Title: Any good example? Hey guys, i am new to Struts. i try to speed up my learning here. could anybody show me a good example? i already got the examples that come with Struts. Can anyone also tell me what role ActionForm plays in Struts? Thanks. See-Yam Lim
Re: Any good example?
There are examples and articles here. It is a good resource. http://www.husted.com/about/struts/ David --- Maya Muchnik <[EMAIL PROTECTED]> wrote: > struts-example is the best known open example how to > use struts. If you > know it with all details - you are in good "shape". > Any form extends > ActionForm. When you will design your application > you will start with > forms design, beans corresponding to them and so > on... > > > See Yam Lim wrote: > > > > > > > Hey guys, > > > > i am new to Struts. i try to speed up my > learning here. could > > anybody show me a good example? i already got the > examples that come > > with Struts. Can anyone also tell me what role > ActionForm plays in > > Struts? > > > > Thanks. > > > > See-Yam Lim > > > __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Re: Locales and images
To have a separate property file for each JSP - it is too much. All the rest - a good idea. I am creating my servlet that extends ActionServlet and does two things: expending destroy and init functions. The reason - I have to initialize some paramaters that I will use in xxxAction through application attributes. Other thing you need to remember that all xxx_xx.properties files do not need to have all messages that in the xxx.properties file. Only what is different. Maya Ken Beyer wrote: > I'm struggling with something very similar and could really > use a recommendation. > > In the Building View Components documentation about i18n, > (http://jakarta.apache.org/struts/userGuide/building_view.html), > it describes using a MyResources.properties (default) and > other MyResources_XX.properties for other languages. > This uses the "application" init-param of the ActionServlet in web.xml. > That's fine and dandy for a small application, but > > for a large JSP application, I don't think I want to maintain *all* my > i18n text (including images!) in a single file per language. > I'm thinking the best way to break this up is to put some "common" > text in a file like CommonResources.properties. Put my images in > a file like ImageResources.properties. And finally put text that > is unique to each JSP file in their own properties files (for example > Foo.jsp -> FooResources.properties, Bar.jsp -> BarResources.properties, > etc.) - and I realize that for each language, I'd need a > BarResources_DE.properties for example, but that's okay. > I think that each of these ResourceBundle's needs to be put under their > own application scoped bean/key, i.e. imageresource -> > com.mycompany.mypackage.ImageResources. > > Question is, is this the right approach? If so, how do I do this? > I think I use ... bundle="fooresource" via each struts tag, (i.e. > ) > And I'd have to load that in advance via each controller servlet (or should > I extend org.apache.struts.action.ActionServlet and load them all there). > Is this all correct? A pointer to an example would help me greatly. > > Thanks, > Ken > > Maya Muchnik wrote: > > > Craig, > > > > Can I ask you on an example to be sure, that it is correct. > > My images are under images directory from root application dir. So, I can put the > > following statements: > > (in a property file : > > message.key=images > > a.image=a.gif > > a.image.dir=images/a.gif > > ) > > > > > > ... > > > > ... > > > > Can I put a.gif into the property file too, and have the second statement as > > this: > > > > Or I can have > > > > > > Thanks, > > > > Maya > > > > "Craig R. McClanahan" wrote: > > > > > There was a recent addition to the and tags to > > > support internationalized images elegantly. > > > > > > Previously, you had to use the "src" attribute to specify the URI of your > > > image. If you needed different images for each language, you had to use a > > > scriptlet expression of some sort to calculate them. > > > > > > Now, you can specify a message key (to be looked up in your application > > > resources) instead: > > > > > > > > > > > > where "message.key" identifies the path to this image from your > > > application resources. > > > > > > If you want to use context-relative paths everywhere, use: > > > > > > > > > > > > instead. > > > > > > > > > > > > Craig > > -- > Ken Beyer > Metatec Internet Products Group > [EMAIL PROTECTED] | http://www.metatec.com/ > "The box said 'Requires Windows 95 or better.' - so I installed Linux."
Re: strange html:form tag
On Tue, 20 Mar 2001, Yuan Jun wrote: > i download jakarta-struts-1.0-b1 today and found next in registration.jsp > > > > > > should it be: > > or i've missed something? > Although the latter still works, the tag has been made smart enough to figure out how an action path is mapped to the controller servlet. The former will work even if you change from path mapping to extension mapping (or vice versa), for example. > John. > > Craig
Re: reloading issue
On Tue, 20 Mar 2001, Ali Ozoren wrote: > Hi all, Im new in this list so please be patient. I looked into docs and > mail archives, and deja but couldnt find a solution to the problem. Every > time I make a chance in the formbean, action, jsp, or the strut-config.xml > file, I have to stop and restart Tomcat. Is this necessary (if yes, dang!), > if not how can I correct this (making every change not requiring restarting > Tomcat)? > Thanks > --a > You should set up a element in your server.xml file with the reloadable="true" attribute. Then, Tomcat will reload your application when any class that is in WEB-INF/classes is changed. Note that Tomcat 3.2 has some inconsistencies in this regard, and does not always detect changes to bean classes. Tomcat 4.0 cures this deficiency. In addition, Struts offers a standard action that tells Struts to reload its configuration files (see the entry in the example application). However, this by itself will not deal with changed Java classes -- the servlet container has to take care of that for you. Craig
RE: strange html:form tag
On Tue, 20 Mar 2001, Troy Hart wrote: > What does that mean? How do you set up your servlet mapping in web.xml then? > You still need to set up your in web.xml, the same as you did before. THe difference is that the Struts controller servlet reads the web.xml file itself at startup time, and remembers which mapping you have selected. If you do the usual extension mapping ("*.do"), it will generate a hyperlink to "/saveRegistration.do"). Likewise, if you use path mapping instead (say, "/execute/*"), the same tag would generate a hyperlink to "/execute/saveRegistration". Craig > -Original Message- > From: Rob Leland [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 20, 2001 6:39 AM > To: [EMAIL PROTECTED] > Subject: Re: strange html:form tag > > > > > Yuan Jun wrote: > > > > i download jakarta-struts-1.0-b1 today and found next in registration.jsp > > > > > > > > > > > > should it be: > > > > Either would be correct. > > The '.do' has been optional since the last week > in January, maybe before. > > > or i've missed something? > > > > John. > > -Rob >
Re: Locales and images
On Tue, 20 Mar 2001, Maya Muchnik wrote: > Craig, > > Can I ask you on an example to be sure, that it is correct. > My images are under images directory from root application dir. So, I can put the > following statements: > (in a property file : > message.key=images > a.image=a.gif > a.image.dir=images/a.gif > ) > > > ... > > ... > > Can I put a.gif into the property file too, and have the second statement as > this: > > Or I can have > > The assumption behind this new facility is that you need to internationalize your images as well as your messages. Perhaps, for example, you've created image buttons and the text of those buttons needs to be different depending on the user's locale. Now, let's take Maya's example, and say that our images are stored in an "images" directory (relative to the context path of this application). Now, in my application resources for English, I might have: image.a=/images/a_en.gif image.b=/images/b.gif while in my application resources for French, I might have: image.a=/images.a_fr.gif image.b=/images.b.gif Note that -- with these settings -- I'm using a different GIF file for the "a" image, but (currently) sharing the "b" image. Now, I can create a single JSP page that grabs the correct version of each image: (When you use the "pageKey" attribute, your paths have to be context relative and start with a slash, just like all the paths in struts-config.xml.) Note one added advantage of this approach. Currently, we're sharing the "b" image because it didn't need to be internationalized. Now, you decide that you really do want to make it different. All you have to do is: * Create the new "/images/b_en.gif" and "/images/b_fr.gif" image files * Change the two lines in your application resources * Restart your app, with no change to any JSP page that uses those images. Pretty slick, huh? :-) > Thanks, > > Maya > Craig > "Craig R. McClanahan" wrote: > > > There was a recent addition to the and tags to > > support internationalized images elegantly. > > > > Previously, you had to use the "src" attribute to specify the URI of your > > image. If you needed different images for each language, you had to use a > > scriptlet expression of some sort to calculate them. > > > > Now, you can specify a message key (to be looked up in your application > > resources) instead: > > > > > > > > where "message.key" identifies the path to this image from your > > application resources. > > > > If you want to use context-relative paths everywhere, use: > > > > > > > > instead. > > > > > > > > Craig > >
Re: Locales and images
On Tue, 20 Mar 2001, Ken Beyer wrote: > > I'm struggling with something very similar and could really > use a recommendation. > > In the Building View Components documentation about i18n, > (http://jakarta.apache.org/struts/userGuide/building_view.html), > it describes using a MyResources.properties (default) and > other MyResources_XX.properties for other languages. > This uses the "application" init-param of the ActionServlet in web.xml. > That's fine and dandy for a small application, but > > for a large JSP application, I don't think I want to maintain *all* my > i18n text (including images!) in a single file per language. > I'm thinking the best way to break this up is to put some "common" > text in a file like CommonResources.properties. Put my images in > a file like ImageResources.properties. And finally put text that > is unique to each JSP file in their own properties files (for example > Foo.jsp -> FooResources.properties, Bar.jsp -> BarResources.properties, > etc.) - and I realize that for each language, I'd need a > BarResources_DE.properties for example, but that's okay. > I think that each of these ResourceBundle's needs to be put under their > own application scoped bean/key, i.e. imageresource -> > com.mycompany.mypackage.ImageResources. > > Question is, is this the right approach? If so, how do I do this? > I think I use ... bundle="fooresource" via each struts tag, (i.e. > ) > And I'd have to load that in advance via each controller servlet (or should > I extend org.apache.struts.action.ActionServlet and load them all there). > Is this all correct? A pointer to an example would help me greatly. > You are correct about the implications of using multiple application resource bundles -- it's a lot of work, but definitely feasible. One alternative strategy to consider is to keep the application resource bundles separate in your *source* code, but combine them together when you deploy the application (for example, you can use the unix "cat" command or the DOS "copy" command to combine text files). As long as the message keys are all unique (which you should manage by requiring specific prefixes for different portions of the app), this will still work fine. The same basic strategy can be used to allow different developers to work on their own portions of the "struts-config.xml" file in the source code, but combine them all together when you create the application itself. > Thanks, > Ken > > Craig
bean: access to the session
Hi, I've a problem with beans. I can use a bean with the writeTag and this works out well. But how can this bean access the session ? I want to read values I placed in the session to use them in the getter methods of the bean.
Re: reloading issue
Craig, Sometimes I can not read your email. What character set you are using? Maya "Craig R. McClanahan" wrote: > This message uses a character set that is not supported by the Internet > Service. To view the original message content, open the attached > message. If the text doesn't display correctly, save the attachment to > disk, and then open it using a viewer that can display the original > character set. <> > > > Name: message.txt >message.txtType: Plain Text (text/plain) > Encoding: quoted-printable
Re: Locales and images
I'm also seeing that it's way too much now (a message resource per jsp). I found the following to be helpful... http://jakarta.apache.org/struts/api/org/apache/struts/util/package-summary.html#doc.Messages I'm thinking of at least starting off with separating the images from text, and maybe breaking the text down into packages later on. Is it correct that I should override ActionServlet, and pass in additional init-param's similar to the "application" one?, i.e. imageresource com.mycompany.mypkg.ImageResources and then make sure that I load it (by overriding init()) and calling a private void initImageResources() + super init(), and similarly for the destroy. Also, I need to set locale to true in the web.xml (Action servlet section), and make sure I use "getMessage(Locale, String, ...)" pretty faithfully, right? Otherwise I'd always get the application's default language. Thx- Ken Maya Muchnik wrote: > To have a separate property file for each JSP - it is too much. All the rest - a good > idea. > I am creating my servlet that extends ActionServlet and does two things: expending > destroy and init functions. The reason - I have to initialize some paramaters that I > will use in xxxAction through application attributes. > > Other thing you need to remember that all xxx_xx.properties files do not need to have > all messages that in the xxx.properties file. Only what is different. > > Maya >
Re: Locales and images
Craig, If b.gif is a shared resource for two resource files, is it true, that only a default resource file (without language extension) needs to have it? Maya "Craig R. McClanahan" wrote: > On Tue, 20 Mar 2001, Maya Muchnik wrote: > > > Craig, > > > > Can I ask you on an example to be sure, that it is correct. > > My images are under images directory from root application dir. So, I can put the > > following statements: > > (in a property file : > > message.key=images > > a.image=a.gif > > a.image.dir=images/a.gif > > ) > > > > > > ... > > > > ... > > > > Can I put a.gif into the property file too, and have the second statement as > > this: > > > > Or I can have > > > > > > The assumption behind this new facility is that you need to > internationalize your images as well as your messages. Perhaps, for > example, you've created image buttons and the text of those buttons needs > to be different depending on the user's locale. > > Now, let's take Maya's example, and say that our images are stored in an > "images" directory (relative to the context path of this > application). Now, in my application resources for English, I might have: > > image.a=/images/a_en.gif > image.b=/images/b.gif > > while in my application resources for French, I might have: > > image.a=/images.a_fr.gif > image.b=/images.b.gif > > Note that -- with these settings -- I'm using a different GIF file for the > "a" image, but (currently) sharing the "b" image. Now, I can create a > single JSP page that grabs the correct version of each image: > > > > > (When you use the "pageKey" attribute, your paths have to be context > relative and start with a slash, just like all the paths in > struts-config.xml.) > > Note one added advantage of this approach. Currently, we're sharing the > "b" image because it didn't need to be internationalized. Now, you decide > that you really do want to make it different. All you have to do is: > * Create the new "/images/b_en.gif" and "/images/b_fr.gif" image files > * Change the two lines in your application resources > * Restart your app, with no change to any JSP page that uses > those images. > > Pretty slick, huh? :-) > > > Thanks, > > > > Maya > > > > Craig > > > "Craig R. McClanahan" wrote: > > > > > There was a recent addition to the and tags to > > > support internationalized images elegantly. > > > > > > Previously, you had to use the "src" attribute to specify the URI of your > > > image. If you needed different images for each language, you had to use a > > > scriptlet expression of some sort to calculate them. > > > > > > Now, you can specify a message key (to be looked up in your application > > > resources) instead: > > > > > > > > > > > > where "message.key" identifies the path to this image from your > > > application resources. > > > > > > If you want to use context-relative paths everywhere, use: > > > > > > > > > > > > instead. > > > > > > > > > > > > Craig > > > >
Re: Locales and images
Craig, As I understand Ken, he wants to have several files and not combine them in a application level. He wants to add one attribute for each tag, where the file name is pointed out. Right Ken? Is it possible? From your response, it is not. Maya "Craig R. McClanahan" wrote: > On Tue, 20 Mar 2001, Ken Beyer wrote: > > > > > I'm struggling with something very similar and could really > > use a recommendation. > > > > In the Building View Components documentation about i18n, > > (http://jakarta.apache.org/struts/userGuide/building_view.html), > > it describes using a MyResources.properties (default) and > > other MyResources_XX.properties for other languages. > > This uses the "application" init-param of the ActionServlet in web.xml. > > That's fine and dandy for a small application, but > > > > for a large JSP application, I don't think I want to maintain *all* my > > i18n text (including images!) in a single file per language. > > I'm thinking the best way to break this up is to put some "common" > > text in a file like CommonResources.properties. Put my images in > > a file like ImageResources.properties. And finally put text that > > is unique to each JSP file in their own properties files (for example > > Foo.jsp -> FooResources.properties, Bar.jsp -> BarResources.properties, > > etc.) - and I realize that for each language, I'd need a > > BarResources_DE.properties for example, but that's okay. > > I think that each of these ResourceBundle's needs to be put under their > > own application scoped bean/key, i.e. imageresource -> > > com.mycompany.mypackage.ImageResources. > > > > Question is, is this the right approach? If so, how do I do this? > > I think I use ... bundle="fooresource" via each struts tag, (i.e. > > ) > > And I'd have to load that in advance via each controller servlet (or should > > I extend org.apache.struts.action.ActionServlet and load them all there). > > Is this all correct? A pointer to an example would help me greatly. > > > > You are correct about the implications of using multiple application > resource bundles -- it's a lot of work, but definitely feasible. > > One alternative strategy to consider is to keep the application resource > bundles separate in your *source* code, but combine them together when you > deploy the application (for example, you can use the unix "cat" command or > the DOS "copy" command to combine text files). As long as the message > keys are all unique (which you should manage by requiring specific > prefixes for different portions of the app), this will still work fine. > > The same basic strategy can be used to allow different developers to work > on their own portions of the "struts-config.xml" file in the source code, > but combine them all together when you create the application itself. > > > Thanks, > > Ken > > > > > Craig
RE: strange html:form tag
OK, so let me see if I understand what you are saying: the tag will trigger FormTag.doStartTag(), which will append ".do" if no extension was specified. I guess it looks first to see if if extension mapping is being used vs. path (???) mapping? Maybe I should go review the tag's java source... :) Thanks, Troy -Original Message- From: Rob Leland [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 9:36 AM To: [EMAIL PROTECTED] Subject: Re: strange html:form tag Then struts html:form tag is processed if the action name does not have a .do at the end, one will be appended so when it is sent out to the browser it will always see a 'XXX.do' present. Troy Hart wrote: > > What does that mean? How do you set up your servlet mapping in web.xml then? > > -Original Message- > From: Rob Leland [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 20, 2001 6:39 AM > To: [EMAIL PROTECTED] > Subject: Re: strange html:form tag > > Yuan Jun wrote: > > > > i download jakarta-struts-1.0-b1 today and found next in registration.jsp > > > > > > > > > > > > should it be: > > > > Either would be correct. > > The '.do' has been optional since the last week > in January, maybe before. > > > or i've missed something? > > > > John. > > -Rob
Re: Locales and images
"Craig R. McClanahan" wrote: > On Tue, 20 Mar 2001, Ken Beyer wrote: > > > > > I'm struggling with something very similar and could really > > use a recommendation. > > > > In the Building View Components documentation about i18n, > > (http://jakarta.apache.org/struts/userGuide/building_view.html), > > it describes using a MyResources.properties (default) and > > other MyResources_XX.properties for other languages. > > This uses the "application" init-param of the ActionServlet in web.xml. > > That's fine and dandy for a small application, but > > > > for a large JSP application, I don't think I want to maintain *all* my > > i18n text (including images!) in a single file per language. > > I'm thinking the best way to break this up is to put some "common" > > text in a file like CommonResources.properties. Put my images in > > a file like ImageResources.properties. And finally put text that > > is unique to each JSP file in their own properties files (for example > > Foo.jsp -> FooResources.properties, Bar.jsp -> BarResources.properties, > > etc.) - and I realize that for each language, I'd need a > > BarResources_DE.properties for example, but that's okay. > > I think that each of these ResourceBundle's needs to be put under their > > own application scoped bean/key, i.e. imageresource -> > > com.mycompany.mypackage.ImageResources. > > > > Question is, is this the right approach? If so, how do I do this? > > I think I use ... bundle="fooresource" via each struts tag, (i.e. > > ) > > And I'd have to load that in advance via each controller servlet (or should > > I extend org.apache.struts.action.ActionServlet and load them all there). > > Is this all correct? A pointer to an example would help me greatly. > > > > You are correct about the implications of using multiple application > resource bundles -- it's a lot of work, but definitely feasible. > > One alternative strategy to consider is to keep the application resource > bundles separate in your *source* code, but combine them together when you > deploy the application (for example, you can use the unix "cat" command or > the DOS "copy" command to combine text files). As long as the message > keys are all unique (which you should manage by requiring specific > prefixes for different portions of the app), this will still work fine. > > The same basic strategy can be used to allow different developers to work > on their own portions of the "struts-config.xml" file in the source code, > but combine them all together when you create the application itself. > > > Thanks, > > Ken > > > > > Craig Duh, cat. why didn't I think of that. use it every day, but didn't even cross my mind here. I'll just make sure my message keys are unique. Anyone have a snippet of a build.xml that's does this "combining" of the properties files? Ken PS -Struts rules!, I was looking for a nice way to separate JSP Java and HTML and I feel Struts is really excellent for this. You've all done a great job developing it and supporting us newcomers. Keep up the great work everyone!
Anyone using Struts with iPlanet application server?
Hi, Has anyone got Struts working with IPlanet application server? What version of IPlanet app server is needed for Struts? Could someone guide me with the steps on how to make it work? Thanks in advance. -Nimmi
RE: strange html:form tag
On Tue, 20 Mar 2001, Troy Hart wrote: > OK, so let me see if I understand what you are saying: > > the tag will trigger FormTag.doStartTag(), > which will append ".do" if no extension was specified. I guess it looks > first to see if if extension mapping is being used vs. path (???) mapping? > At startup time, the Struts controller servlet reads the web.xml file and finds out what entry you have selected. If you use extension mapping, will append the appropriate suffix (for example, "/saveCustomer.do") On the other hand, if you used: action /process/* The submitted URL will be something like "/process/saveCustomer" instead. > Maybe I should go review the tag's java source... :) > That's always useful :-). > Thanks, > > Troy > Craig
PropertyUtils.copyProperties ?
Hi, If I am using PropertyUtils.copyProperties(user, info) then original bean info must to have all properties that user bean has? If info has only 3 properties, and user has 18, copy will not work? I need to use this way, because, for example, logon form needs only 3 properties, but user form (full user info) has 18 properties. And only user bean has a method (function) to check if a user is legal. Thanks in advance. Maya
Re: Locales and images
> Anyone have a snippet of a build.xml that's does this "combining" of > the properties files? Craig/etc, I'm not an Ant expert, but managed to do the "cat" (of my properties files) you suggested by putting the following in my build.xml. I know it's more Ant specific than Struts, but do you know if there's a better/easier way than this? ... Thx, Ken
Re: bean: access to the session
On Fri, 4 Jan 1980, hunkpapa wrote: > >
Re: bean: access to the session
On Fri, 4 Jan 1980, hunkpapa wrote: > Hi, > I've a problem with beans. > I can use a bean with the writeTag and this works out well. > > But how can this bean access the session ? > I want to read values I placed in the session > to use them in the getter methods of the bean. > > > If the bean itself is a String you want to write: If the bean is an object whose property you want to write: In general, most Struts tags that accept a "name" attribute also let you specify a "scope" attribute. Craig McClanahan
Re: Locales and images
On Tue, 20 Mar 2001, Ken Beyer wrote: > > Anyone have a snippet of a build.xml that's does this "combining" of > > the properties files? > Looks pretty reasonable to me. It looks like a platform-inpendent task might be a nice contribution to Ant, because this won't work under Windows unless you've got CYGWIN installed. Craig
Re: bean: access to the session
I've had a cmos-error but now the date is right. Maya Muchnik schrieb: > What date you have in your computer ? Fri, 04 Jan 1980 18:46:20 ? > > hunkpapa wrote: > > > Hi, > > I've a problem with beans. > > I can use a bean with the writeTag and this works out well. > > > > But how can this bean access the session ? > > I want to read values I placed in the session > > to use them in the getter methods of the bean.
Struts on EAS 3.6.1, anyone?
Hello, Did anyone successfully deployed struts-example on EAS 3.6.1? I am getting the following error: 500 Servlet jspservlet: unable to service request: Unable to compile class for JSPC:\Program Files\Sybase\Jaguar CTS 3.5\work\Jaguar\Servlet\WebApp-struts-example\_0005cindex_0002ejspindex_jsp_ 0.java:72: Incompatible type for method. Can't convert java.lang.String to boolean. _jspx_th_html_html_0.setLocale("true"); ^ 1 error Also, java source can't be found under directory menioned above. Thanks, Mark. -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers Inc. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.
Re: Struts on EAS 3.6.1, anyone?
On Tue, 20 Mar 2001, Zeltser, Mark wrote: > Hello, > > Did anyone successfully deployed struts-example on EAS 3.6.1? I am getting > the following error: > > 500 Servlet jspservlet: unable to service request: Unable to compile class > for JSPC:\Program Files\Sybase\Jaguar CTS > 3.5\work\Jaguar\Servlet\WebApp-struts-example\_0005cindex_0002ejspindex_jsp_ > 0.java:72: Incompatible type for method. Can't convert java.lang.String to > boolean. _jspx_th_html_html_0.setLocale("true"); ^ 1 error > Also, java source can't be found under directory menioned above. > Thanks, Mark. > That looks like a problem that occurs with several servlet containers. JSP compilers are required to perform conversions between the String version of custom tag attribute values and the corresponding data type of the underlying property (boolean in this case). This requirement was not clear in the JSP 1.1 spec, but was clarified in an errata published last April, available at: http://java.sun.com/products/jsp/download.html This should probably be reported as a bug to Sybase. Craig McClanahan
more on ActionForms
Struts appears to be ignoring the ActionForms that I am trying to manually put in the session. If the ActionForm is not the same class type as what is defined in struts-config.xml then Struts ignores it and creates a new one when the page is processed. Is this the intended behavior? If so, I would like to propose a slight change to the logic Struts uses when creating an instance of an action form. Currently, as I understand it, Struts will check to see if an instance of the ActionForm exists in the session based on the name assigned to the attribute and the class type of the attribute. If either do not match, then Struts creates a new ActionForm of the type defined in the mapping. What about changing this so that the object in the session can be of the same type, *or* a subclass of the class specified in the struts-config.xml? Can anyone think of a scenario where this would cause problems? I am having problems with the design of my application because of this. If this functionality was supported things would become simpler and the app would be more extensible. Comments? -Bob -Original Message- From: Hayden,Robert IT BIP-US-R Sent: Tuesday, March 20, 2001 1:09 AM To: [EMAIL PROTECTED] Subject: Object oriented question regarding ActionForms I have an object oriented question related to how Struts instantiates an ActionForm. What I am trying to do is utilize a factory for creation of my ActionForms. In my application, I have a base (abstract) ActionForm class called Fermentation, and subclasses FermentationYeast, FermentationEcoli, etc... The factory is called from my Action servlet to create the appropriate instance of an ActionForm (a subtype of Fermentation). Then I save the newly created ActionForm in the session. The object type that gets saved in the session is the subtype, but in my Struts config I am specifying the base type. I want Struts to read this object from the session, but Struts always creates a new ActionForm of the base type. I want it to find and use the subtype! For example, the Action servlet calls the factory and the factory returns a FermentationYeast. This object is saved in the session, and then I forward to the EditFermentation page. The EditFermentation page is mapped in the Struts config to use a Fermentation form, so Struts does not recognize the FermentationYeast that is already in the session and it creates a new ActionForm. Even though a FermentationYeast *is a* Fermentation, Struts does not seem to support this. I think it would be helpful if Struts supported generalization... or if it does and I am missing something here please let me know :) Or, If you think I should change my design, please let me know this as well. I think I have a good reason to need to do this. The first page is where the user enters common information, then the next page is loaded based on the type of the Fermentation (ActionFrom). I could create 2 separate ActionForms (one for the common attributes and then another for the details) but I would like to use inheritance to model this relationship. In other words, I want to create a single ActionForm which will be used across multiple pages, but I want to share pages that ask for the same information. Thanks, Bob
Re: bean: access to the session
What date you have in your computer ? Fri, 04 Jan 1980 18:46:20 ? hunkpapa wrote: > Hi, > I've a problem with beans. > I can use a bean with the writeTag and this works out well. > > But how can this bean access the session ? > I want to read values I placed in the session > to use them in the getter methods of the bean.
Re: Locales and images
On Tue, 20 Mar 2001, Maya Muchnik wrote: > Craig, > > If b.gif is a shared resource for two resource files, is it true, that only a >default > resource file (without language extension) needs to have it? > That is technically correct. I have found, though, that this sometimes confuses the people responsible for maintaining the resource bundles -- it's been easier for me to include all message keys in all bundles. Your mileage may vary. > Maya > Craig
Re: PropertyUtils.copyProperties ?
Thank you, Craig. You were right. I had removed (and forgot) a hidden property, because I cannot figure out how to replace "nested tags". Can somebody help me to replace Do I need to use and bean class is org.apache.struts.BEAN ... Thanks, Maya "Craig R. McClanahan" wrote: > On Tue, 20 Mar 2001, Maya Muchnik wrote: > > > Hi, > > > > If I am using PropertyUtils.copyProperties(user, info) then original bean > > info must to have all properties that user bean has? If info has only 3 > > properties, and user has 18, copy will not work? I need to use this way, > > because, for example, logon form needs only 3 properties, but user form (full > > user info) has 18 properties. And only user bean has a method (function) to > > check if a user is legal. > > > > The copyProperties() method will only copy when the property names > match. It will ignore any unmatching properties in the origin or > destination beans. > > > Thanks in advance. > > > > Maya > > > > > > Craig
RE: HELP - "Illegal target of jump or branch"
Marc, This may be related to the size of you resulting jspservice method. If that is the case you need to break it up into multiple includes - as recommended to someone else earlier today. lar -Original Message- From: Marc Ellison [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 3:07 PM To: '[EMAIL PROTECTED]' Cc: Kyle Robinson Subject: HELP - "Illegal target of jump or branch" Hi, I have been getting a very interesting error folks ;-) I have constructed a jsp file that uses ALOT of struts-defined tags, and which I have running with Tomcat. Initially the page would not work so I commented out a lot of the code. The page now works to an extent, but as soon as I try to uncomment any of the other struts tags it throws this error message. javax.servlet.ServletException: (class: _0002fdemographicDetails_0002ejspdemographicDetails_jsp_73, method: _jspService signature: (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletRespo nse;)V) I have looked in the mail archive and one guy suggested changing the values of the stack/memory allocation pools to a higher value as it couldn't cope with the number of tags. However, I still get the same error. Has anybody encountered a similar problemif so please HELP!! Kind regards Marc
Re: HELP - "Illegal target of jump or branch"
Several guys suggested to replace a lot of tags in one JSP to several JSPs, and make the first one with <@ include file=.../> Marc Ellison wrote: > Hi, > > I have been getting a very interesting error folks ;-) > > I have constructed a jsp file that uses ALOT of struts-defined tags, and > which I have running with Tomcat. Initially the page would not work so I > commented out a lot of the code. The page now works to an extent, but as > soon as I try to uncomment any of the other struts tags it throws this error > message. > > javax.servlet.ServletException: (class: > _0002fdemographicDetails_0002ejspdemographicDetails_jsp_73, method: > _jspService signature: > (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletRespo > nse;)V) > > I have looked in the mail archive and one guy suggested changing the values > of the stack/memory allocation pools to a higher value as it couldn't cope > with the number of tags. However, I still get the same error. Has anybody > encountered a similar problemif so please HELP!! > Kind regards > Marc
Re: HELP - "Illegal target of jump or branch"
I know other folks here have run into the Java (not Tomcat, not Struts) limitation of methods being no bigger than 64K (lines? bytecode?). I'm not sure what the resulting error is, but that may be your problem. Donnie >>> [EMAIL PROTECTED] 03/20/01 03:06PM >>> Hi, I have been getting a very interesting error folks ;-) I have constructed a jsp file that uses ALOT of struts-defined tags, and which I have running with Tomcat. Initially the page would not work so I commented out a lot of the code. The page now works to an extent, but as soon as I try to uncomment any of the other struts tags it throws this error message. javax.servlet.ServletException: (class: _0002fdemographicDetails_0002ejspdemographicDetails_jsp_73, method: _jspService signature: (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletRespo nse;)V) I have looked in the mail archive and one guy suggested changing the values of the stack/memory allocation pools to a higher value as it couldn't cope with the number of tags. However, I still get the same error. Has anybody encountered a similar problemif so please HELP!! Kind regards Marc
Re: PropertyUtils.copyProperties ?
On Tue, 20 Mar 2001, Maya Muchnik wrote: > Hi, > > If I am using PropertyUtils.copyProperties(user, info) then original bean > info must to have all properties that user bean has? If info has only 3 > properties, and user has 18, copy will not work? I need to use this way, > because, for example, logon form needs only 3 properties, but user form (full > user info) has 18 properties. And only user bean has a method (function) to > check if a user is legal. > The copyProperties() method will only copy when the property names match. It will ignore any unmatching properties in the origin or destination beans. > Thanks in advance. > > Maya > > Craig
HELP - "Illegal target of jump or branch"
Hi, I have been getting a very interesting error folks ;-) I have constructed a jsp file that uses ALOT of struts-defined tags, and which I have running with Tomcat. Initially the page would not work so I commented out a lot of the code. The page now works to an extent, but as soon as I try to uncomment any of the other struts tags it throws this error message. javax.servlet.ServletException: (class: _0002fdemographicDetails_0002ejspdemographicDetails_jsp_73, method: _jspService signature: (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletRespo nse;)V) I have looked in the mail archive and one guy suggested changing the values of the stack/memory allocation pools to a higher value as it couldn't cope with the number of tags. However, I still get the same error. Has anybody encountered a similar problemif so please HELP!! Kind regards Marc
Re: Locales and images
Check out Ant 1.3. The user list said that a task has been added. HTH, Pete "Craig R. McClanahan" wrote: > On Tue, 20 Mar 2001, Ken Beyer wrote: > > > > Anyone have a snippet of a build.xml that's does this "combining" of > > > the properties files? > > > > Looks pretty reasonable to me. It looks like a platform-inpendent > task might be a nice contribution to Ant, because this won't work under > Windows unless you've got CYGWIN installed. > > Craig begin:vcard n:; x-mozilla-html:FALSE org:http://www.irista.com/logo/irista.gif">Bringing Vision to Your Supply Chain adr:;; version:2.1 end:vcard
Re: HELP - "Illegal target of jump or branch"
I am, unfortunately, intimately familiar with this problem. The problem is that there is a limit on the size of a compiled method in a Java class file, and that limit is what we're running up against. Recall that a JSP page is compiled into a servlet, and into essentially only one method in that servlet. Hence, if your page contains many, many tags, that method becomes too big, and up comes the exception that you're seeing. There are a couple of (partial) solutions. 1) Break your giant page up into multiple smaller pages and bring them together at run time using . Note that <%@include> won't work, because that's a compile-time include, which will get you straight back to the original problem. 2) Look for places to save on tags. For example, the tag was recently extended to allow the specification of the text to display, so that you can replace this: with this: If you have a lot of cases of this pattern, it can help quite a bit. In addition to the tag, some other Struts tags allow the same shortcut to including the text. Also, you might consider replacing sequences with if you can build an appropriate collection up front. Unfortunately, we can't use solution (1), because our giant page is almost entirely one . (Please don't ask... :-} ) Many of the tags won't work if they are on a separate page from the tag itself. That means I've spent quite some time on option (2). We have several of our own tags, too, so that was the next place for me to look. I discovered that changing some frequently used tags from extending BodyTagSupport to extending TagSupport, and marking them with empty in the .tld file, made a significant reduction in generated code size. Of course, this is not always feasible, but it helped us quite a bit. One other trick is to create custom tags for frequently used groups of related elements. For example, I created a simple DatePickerTag which is a Struts-like tag that combines three drop-down boxes for month, day and year, with the localized strings obtained from the JVM, and the current values pulled from a bean. That's about all I can think of that I've tried so far. All our pages are now within the limit, but one is very close to breaking it. I really want to put a "do not touch" notice on that file! Hope this helps. -- Martin Cooper At 12:06 PM 3/20/01, Marc Ellison wrote: >Hi, > >I have been getting a very interesting error folks ;-) > >I have constructed a jsp file that uses ALOT of struts-defined tags, and >which I have running with Tomcat. Initially the page would not work so I >commented out a lot of the code. The page now works to an extent, but as >soon as I try to uncomment any of the other struts tags it throws this error >message. > >javax.servlet.ServletException: (class: >_0002fdemographicDetails_0002ejspdemographicDetails_jsp_73, method: >_jspService signature: >(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletRespo >nse;)V) > >I have looked in the mail archive and one guy suggested changing the values >of the stack/memory allocation pools to a higher value as it couldn't cope >with the number of tags. However, I still get the same error. Has anybody >encountered a similar problemif so please HELP!! >Kind regards >Marc
struts access to getter with parameters
Hi, Is there a way to pass arguments to the getters that are used in the property tag? ex: bean:write name="customer" property='companyName("CA")' scope="session"/> Thanks Rupa
bean: access to the session
Hi, I've a problem with beans. I can use a bean with the writeTag and this works out well. But how can this bean access the session ? I want to read values I placed in the session to use them in the getter methods of the bean.
Re: Locales and images
I am not sure about several resource files. I have try to create other servlet and "match" it to other file, initialize this file. But then what? It will stay in the memory and do nothing? Then how about reload function? You need rewrite it too (run super.reload(), destroy your local info, init your local info). It is not difficult if one file. For second one and new servlet Thanks, Maya Ken Beyer wrote: > I'm also seeing that it's way too much now (a message resource per jsp). > > I found the following to be helpful... > >http://jakarta.apache.org/struts/api/org/apache/struts/util/package-summary.html#doc.Messages > > I'm thinking of at least starting off with separating the images from text, > and maybe breaking the text down into packages later on. Is it correct that > I should override ActionServlet, and pass in additional init-param's similar > to the "application" one?, i.e. > > > imageresource > com.mycompany.mypkg.ImageResources > > > and then make sure that I load it (by overriding init()) and calling a > private void initImageResources() + super init(), and similarly for the destroy. > > Also, I need to set locale to true in the web.xml (Action servlet section), and > make sure I use "getMessage(Locale, String, ...)" pretty faithfully, right? > Otherwise I'd always get the application's default language. > > Thx- > Ken > > Maya Muchnik wrote: > > > To have a separate property file for each JSP - it is too much. All the rest - a >good > > idea. > > I am creating my servlet that extends ActionServlet and does two things: expending > > destroy and init functions. The reason - I have to initialize some paramaters that >I > > will use in xxxAction through application attributes. > > > > Other thing you need to remember that all xxx_xx.properties files do not need to >have > > all messages that in the xxx.properties file. Only what is different. > > > > Maya > >
Can't access ActionForm properties in Action perform()!
Hi, There: I have some question regarding access the actionform, I have two Actions, one is "edit" and one is "save", they both share the same form just like struts-example, when I do the edit, the form is access fun, but when I do the save, the ActionForm is not null, but content in form is null, I am really no sure is the scope problem or something else. If anybody have similar problem before, please give some help. Thanks in advance. Regards Frank Ling
Re: Can't access ActionForm properties in Action perform()!
On Tue, 20 Mar 2001, Frank Ling wrote: > Hi, There: > > I have some question regarding access the actionform, I have two Actions, one is >"edit" and one is "save", they both share the same form just like struts-example, >when I do the edit, the form is access fun, but when I do the save, the ActionForm is >not null, but content in form is null, I am really no sure is the scope problem or >something else. > Make sure that you've declared your dependence on the form bean in *both* entries in struts-config.xml (using the same bean name and scope), as the example does: > If anybody have similar problem before, please give some help. > > Thanks in advance. > > Regards > > Frank Ling > Craig
the errors tag
Hi, Am trying out the errors tag but to no avail...I have the following code in my validate() method of my relevant Form class... public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); //if (phn == null) errors.add("phn", new ActionError("phn can't be null")); } ...and then have the tag in my jsp. However when I process the request having left the "phn" field empty, nothing pops up on my jsp page. Am i missing something vital here. I have followed the docs and API to no avail! Thanks Marc
Multipart problems
(I originally posted this to struts-dev, but since I'm really looking for confirmation of these problems from other users, I guess I should post it here.) I've been having a host of problems associated with multipart input: (1) cancel detection fails and must be special-cased; (2) transaction token checking fails and must be special-cased; (3) parameters that are ordinarily available via request.getParameter() must be accessed via an ActionForm; (4) forwards from pages that use multipart input fail unless redirect=true. If anyone can tell me what I'm doing wrong, I'll be grateful. Alternatively, if some or all of these are genuine problems, I'll be glad to supply more details and file bug reports or enhancement requests as appropriate. Thanks. -r
Re: Can't access ActionForm properties in Action perform()!
HI, Craig: Thank you very much for your quick reply, but I did exactlly like example. here is related info for my struts-config.xml. I did have name and scope be the same, but some how still give me error. Thanks. Frank Ling - Original Message - From: Craig R. McClanahan <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 20, 2001 2:53 PM Subject: Re: Can't access ActionForm properties in Action perform()! > > > On Tue, 20 Mar 2001, Frank Ling wrote: > > > Hi, There: > > > > I have some question regarding access the actionform, I have two Actions, one is "edit" and one is "save", they both share the same form just like struts-example, when I do the edit, the form is access fun, but when I do the save, the ActionForm is not null, but content in form is null, I am really no sure is the scope problem or something else. > > > > Make sure that you've declared your dependence on the form bean in *both* > entries in struts-config.xml (using the same bean name and scope), as the > example does: > > ... > name="registrationForm" >scope="request" > ... > /> > > ... > name="registrationForm" >scope="request" > ... > /> > > > If anybody have similar problem before, please give some help. > > > > Thanks in advance. > > > > Regards > > > > Frank Ling > > > > Craig > > >
Which? IPlanet Application server or IPlanet web server with Struts
Hi, I am forced to use IPlanet for putting my application into production. I am wondering if I could use just IPlanet Web Server (IWS) for my application using Struts instead of having to use IPlanet application server(IAS). My application consists of JSPs, Servlets and Java Beans( and no EJBs). Do I need an application server in such a scenerio or would a web server be sufficient? I would really appreciate responses from anyone who has successfully used IPlanet products with Struts. Thanks. -Nimmi
New to struts..
I'm new to struts and started using it (just deployed the struts-example). I wonder whether we could use struts out of the Web Application Archive, as an extracted one, without any reference to web.xml and just refer only the tld and struts.jar file. Are there any sample or simple application demonstrating the above. Thanks in advance Senthil Kumar.S ** The Information transmitted herewith is sensitive information intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.
Re: HELP - "Illegal target of jump or branch"
As I mentioned in an earlier post on this topic, using <%@include%> does not help, since it's a compile time include (similar to #include in C++). Using can help, though. -- Martin Cooper At 01:44 PM 3/20/01, Maya Muchnik wrote: >Several guys suggested to replace a lot of tags in one JSP to several >JSPs, and >make the first one with <@ include file=.../> > >Marc Ellison wrote: > > > Hi, > > > > I have been getting a very interesting error folks ;-) > > > > I have constructed a jsp file that uses ALOT of struts-defined tags, and > > which I have running with Tomcat. Initially the page would not work so I > > commented out a lot of the code. The page now works to an extent, but as > > soon as I try to uncomment any of the other struts tags it throws this > error > > message. > > > > javax.servlet.ServletException: (class: > > _0002fdemographicDetails_0002ejspdemographicDetails_jsp_73, method: > > _jspService signature: > > > (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletRespo > > nse;)V) > > > > I have looked in the mail archive and one guy suggested changing the values > > of the stack/memory allocation pools to a higher value as it couldn't cope > > with the number of tags. However, I still get the same error. Has anybody > > encountered a similar problemif so please HELP!! > > Kind regards > > Marc
Re: the errors tag
Have you set validate to true in you struts-config.xml? David --- Marc Ellison <[EMAIL PROTECTED]> wrote: > Hi, > > Am trying out the errors tag but to no avail...I > have the following code in > my validate() method of my relevant Form class... > > public ActionErrors validate(ActionMapping mapping, > HttpServletRequest > request) { > ActionErrors errors = new ActionErrors(); > //if (phn == null) >errors.add("phn", new > ActionError("phn can't be null")); > } > > ...and then have the tag in my jsp. > However when I process > the request having left the "phn" field empty, > nothing pops up on my jsp > page. Am i missing something vital here. I have > followed the docs and API to > no avail! > > Thanks > > Marc > > __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
REPOST: HOW TO: check for null property value
How do I use the logic tags to check for a null property value on a bean and include/exclude HTML segment on that basis? I have a bean in the session that holds references to other beans. If the references are not-null then I need to display some info about them. I've tried using and http://www.trysoft.com/ e-mail: [EMAIL PROTECTED] Please Note: This document (including attachments) is only intended for the addressee/s and may contain privileged or confidential information. Unauthorised use, copying or distribution of the document or any part of its contents, is prohibited. If you receive this e-mail in error please notify us by return e-mail or telephone. Any views expressed in this Communication are those of the individual sender, except where the sender specifically states them to be the views of Trysoft Corporation Limited. Except as required at law, Trysoft Corporation Limited does not represent, warrant and/or guarantee that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.
RE: the errors tag
Hi, Have just adjusted that but still there is no error coming upany other ideas? Thanks Marc -Original Message- From: David Winterfeldt [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 3:36 PM To: [EMAIL PROTECTED] Subject: Re: the errors tag Have you set validate to true in you struts-config.xml? David --- Marc Ellison <[EMAIL PROTECTED]> wrote: > Hi, > > Am trying out the errors tag but to no avail...I > have the following code in > my validate() method of my relevant Form class... > > public ActionErrors validate(ActionMapping mapping, > HttpServletRequest > request) { > ActionErrors errors = new ActionErrors(); > //if (phn == null) >errors.add("phn", new > ActionError("phn can't be null")); > } > > ...and then have the tag in my jsp. > However when I process > the request having left the "phn" field empty, > nothing pops up on my jsp > page. Am i missing something vital here. I have > followed the docs and API to > no avail! > > Thanks > > Marc > > __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Re: New to struts..
On Tue, 20 Mar 2001, Suriyanarayanan, Senthil Kumar wrote: > I'm new to struts and started using it (just deployed the struts-example). I > wonder whether we could > use struts out of the Web Application Archive, as an extracted one, without > any reference to web.xml and just > refer only the tld and struts.jar file. Are there any sample or simple > application demonstrating the above. > Struts critically depends on several things that are only configurable in the web application deployment descriptor (web.xml) file, including: * Configuration parameters for the controller servlet * The servlet mapping mechanism used to map requests to the controller servlet (typically using the "*.do" extension mapping pattern) * The fact that the controller servlet should be loaded at startup time, so that the application resources are initialized correctly * References to the various tag library descriptor files (TLDs) that are used in this application Struts depends on these features, so it is not practical to run a web application without the web.xml deployment descriptor being properly configured. > Thanks in advance > Senthil Kumar.S > Craig McClanahan
Re: REPOST: HOW TO: check for null property value
On Wed, 21 Mar 2001, Matthew O'Haire wrote: > How do I use the logic tags to check for a null property value on a bean and > include/exclude HTML segment on that basis? > > I have a bean in the session that holds references to other beans. If the > references are not-null then I need to display some info about them. I've > tried using and > ... the value is not null ... or ... the value is null ... > Can anyone help me out here. > Thanks. > > > Matthew O'Haire > Technical Manager > email: [EMAIL PROTECTED] > Craig McClanahan
RE: the errors tag
I'm not sure. Here is a quick run down of things. 1. You are extending ActionForm. 2. The interface to you're validate method looks fine. 3. Validate is set to true in the action in the struts-config.xml. 4. You correctly have the ActionForm associated with the correct action in the struts-config.xml. 5. You are submitting to the correct action. I would put a println or log a message from your validate method and see if it is actually being called. If the validate is set to true in the xml configuration, then it will call the validate method and put the object in scope for to use. If the validate method isn't being called, make sure that the form-bean name attribute matches the action name (case sensitive). I assume you are using a recent build of Struts. David --- Marc Ellison <[EMAIL PROTECTED]> wrote: > Hi, > > Have just adjusted that but still there is no error > coming upany other > ideas? > > Thanks > > Marc > > -Original Message- > From: David Winterfeldt > [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 20, 2001 3:36 PM > To: [EMAIL PROTECTED] > Subject: Re: the errors tag > > > Have you set validate to true in you > struts-config.xml? > > type="RegistrationAction" >name="registrationForm" >scope="request" >validate="true" >input="/registration.jsp"> > path="/index.jsp"/> > > > David > > --- Marc Ellison <[EMAIL PROTECTED]> wrote: > > Hi, > > > > Am trying out the errors tag but to no avail...I > > have the following code in > > my validate() method of my relevant Form class... > > > > public ActionErrors validate(ActionMapping > mapping, > > HttpServletRequest > > request) { > > ActionErrors errors = new ActionErrors(); > > //if (phn == null) > > errors.add("phn", new > > ActionError("phn can't be null")); > > } > > > > ...and then have the tag in my jsp. > > However when I process > > the request having left the "phn" field empty, > > nothing pops up on my jsp > > page. Am i missing something vital here. I have > > followed the docs and API to > > no avail! > > > > Thanks > > > > Marc > > > > > > > __ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/ __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Re: the errors tag
The constructor for ActionError takes the key for the error message, not the error message itself. This key is then used to look up the (possibly localized) message in a message resource. If the key is not found, by default null will be returned, and nothing will be displayed. This is most likely why you are not seeing anything. However, you can set a servlet init param to change this behaviour. Adding this to your web.xml: null false will cause the string "???key???" (where key is the key name you supplied) to be returned, and subsequently displayed, when the requested resource is not found. Hope this helps. -- Martin Cooper At 03:17 PM 3/20/01, Marc Ellison wrote: >Hi, > >Am trying out the errors tag but to no avail...I have the following code in >my validate() method of my relevant Form class... > >public ActionErrors validate(ActionMapping mapping, HttpServletRequest >request) { > ActionErrors errors = new ActionErrors(); > //if (phn == null) > errors.add("phn", new ActionError("phn can't be null")); >} > >...and then have the tag in my jsp. However when I process >the request having left the "phn" field empty, nothing pops up on my jsp >page. Am i missing something vital here. I have followed the docs and API to >no avail! > >Thanks > >Marc >
Forms Engine?
Hi, I am in the process of building an application with a large number of screens. Each of these screens will conform to one of a small number of pre-defined templates / classes. What I am looking to do is find a tool and/or design that allows sort of a "parameterized form" to be built at run-time. The form would be built by combining the appropriate JSP template with the form definition. This saves us the hassle of stamping several hundred very similar pages, ensures consistency, and reduces errors. Has anyone tried doing this with Struts? Thanks, Anthony __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Mouseover effects on links
Hi, I'm pretty new to struts, so please forgive me if this is a stupid question. Our page designers have given me hyperlinks with roll-over effects thus: I'd like to do something like: but clearly this won't work. Is there another way to achieve the same effect? Can I simply use the tags? What is the drawback. Matthew O'Haire Technical Manager email: [EMAIL PROTECTED] IT Project Services & Solutions · Development · Integration · Support · People · 44 Benson Street, Toowong, Queensland, Australia. 4066 ph: +61-7-3870 7070 fx: +61-7-3870 3480 www: http://www.trysoft.com/ e-mail: [EMAIL PROTECTED] Please Note: This document (including attachments) is only intended for the addressee/s and may contain privileged or confidential information. Unauthorised use, copying or distribution of the document or any part of its contents, is prohibited. If you receive this e-mail in error please notify us by return e-mail or telephone. Any views expressed in this Communication are those of the individual sender, except where the sender specifically states them to be the views of Trysoft Corporation Limited. Except as required at law, Trysoft Corporation Limited does not represent, warrant and/or guarantee that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.
RE: strange html:form tag
> On Tue, 20 Mar 2001, Yuan Jun wrote: > > > i download jakarta-struts-1.0-b1 today and found next in > registration.jsp > > > > > > > > > > > > should it be: > > > > or i've missed something? > > > > Although the latter still works, the tag has been made smart > enough to figure out how an action path is mapped to the controller > servlet. The former will work even if you change from path mapping to > extension mapping (or vice versa), for example. > i see. but when i depoyed struts-example to orion 1.4.5, it did work. i have to modify jsp files adding .do to html:form to make it work, is it a bug of orion? > > John. > > > > > > Craig > > John
Multiple bean on a JSP file
Hi all, Is it possible for me to declare two or more beans on the JSP files that use struts framework. I want to split input from the user into many beans but don't want to provide an extra bean to capture all input and perform splitting work in the Action. Thanks. Nguyen Thanh Phong Tel: 84-8-837 25 06/837 25 07 Saigon Software Development Company (SDC)Fax: 84-8-837 25 11 10 Co Giang Street, Dist I, HCMC Email: [EMAIL PROTECTED] Vietnam
getter methods ...
I'm new to struts and trying to get my index.jsp to show up, but instead I get the following error: 500 Internal Server Error javax.servlet.jsp.JspException: No getter method available for property View for bean under name org.apache.struts.taglib.html.BEAN at org.apache.struts.taglib.html.RadioTag.doStartTag(RadioTag.java, Compiled Code) at /index.jsp._jspService(/index.jsp.java, Compiled Code) at com.orionserver.http.OrionHttpJspPage.service(JAX, Compiled Code) at com.evermind.server.http.HttpApplication.xj(JAX, Compiled Code) at com.evermind.server.http.JSPServlet.service(JAX, Compiled Code) at com.evermind.server.http.d3.sw(JAX, Compiled Code) at com.evermind.server.http.d3.su(JAX, Compiled Code) at com.evermind.server.http.ef.s1(JAX, Compiled Code) at com.evermind.server.http.ef.do(JAX, Compiled Code) at com.evermind.util.f.run(JAX, Compiled Code) Somehow I think the ViewForm bean is not being found as I've got the properties included, but it seems to be defaulting to another bean. I don't think I've got to map the properties to the bean, as they map automatically to the bean in the action form, right? I've included all my files trying to get a simple example going. Any help much appreciated. - ViewForm.java - package com.neuroquest.cais.actions; import org.apache.struts.action.ActionForm; public class ViewForm extends ActionForm { protected String viewName; public String getView() { return viewName; } public void setView(String view) { this.viewName = view; } } - ViewAction.java - package com.neuroquest.cais.actions; import javax.servlet.http.*; import org.apache.struts.action.*; public class ViewAction extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { // turn form instance into custom form bean. ViewForm viewForm = (ViewForm) form; String viewName = viewForm.getView(); if (viewName.equals("Master View")) { return mapping.findForward("master"); } else if (viewName.equals("Details View")) { return mapping.findForward("details"); } return mapping.findForward("error"); } } - inside my web.xml - action org.apache.struts.action.ActionServlet application com.neuroquest.cais.resources.cais config /WEB-INF/struts-config.xml validate true 1 action *.do - struts-config.xml - http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd"> inside my index.jsp
RE: getter methods ...
Hi, I think the culprit is in your JSP.. The property names are case-sensitive. Try property="view".
Re: getter methods ...
Thanxs, I thought it was supposed to be the same case as what was in the getter method. Thnxs again. - Original Message - From: "Matthew O'Haire" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 20, 2001 9:56 PM Subject: RE: getter methods ... > > Hi, > > I think the culprit is in your JSP.. > > > > The property names are case-sensitive. Try property="view". >
RE: Any good example?
Title: RE: Any good example? Hi, ActionForm is called ActionClass. In this all Business Rules are coded. Regards Mallari -Original Message- From: See Yam Lim [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 9:37 AM To: Struts (E-mail) Subject: Any good example? Hey guys, i am new to Struts. i try to speed up my learning here. could anybody show me a good example? i already got the examples that come with Struts. Can anyone also tell me what role ActionForm plays in Struts? Thanks. See-Yam Lim
RE: Alternative Frameworks - continued
Eric, Have you looked into ASP.net vs ...? > -Original Message- > From: Eric Brown [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 13, 2001 1:33 PM > To: '[EMAIL PROTECTED]' > Subject: RE: Alternative Frameworks - continued > > > My team did an evaluation of Turbine and struts three months > ago and Turbine > has some advantages, but while we had trouble getting both Turbine and > struts to work, Turbine was impossible while struts was merely > difficult. I > also think the pull-MVC model that struts uses is superior in > the long-run > to Turbine's push model. > > I'm happy to report that my team is actively developing with > struts and that > we have overcome the difficulties most usually have to overcome when > learning struts (and likely any new framework). > > Bellow is my original message with comparison data, etc. > > -Original Message- > From: Eric Brown > Sent: Monday, December 11, 2000 10:46 PM > To: Turbine; [EMAIL PROTECTED] > Cc: Yogieric (E-mail) > Subject: App framework eval: Turbine and/or Struts - Push vs. Pull MVC > > I'm looking for an application framework for future work at my > company and > am considering Turbine, Stuts and a few others. (My company > currently uses > IIS/ASP/SQL Server and will move to apache/Java app server, > Tomcat first and > Resin later as performance dictates, and Oracle.) Turbine seems > to have the > most features including Torque (DB abstraction) and a > personalization engine > that are important to me. However, as the push versus pull MVC paradigms > (http://java.apache.org/turbine/pullmodel.html) recently > discussed on the > Turbine list concluded, Turbine's preferred UI language, > Velocity, is a push > model that does not allow me to develop tag-like APIs for my UI/HTML > designers the way struts does, a pull MVC model. I believe > Turbine allows > raw JSP that would allow me to use Turbine AND struts where appropriate > although I'm not sure that's the best answer either. > > Pri Issue ASP JSP Enhydra > Struts Turbine > XML/XSL > 1 Separate UI from business logic XXX X XXX > X > 1 Database abstraction layer XXX > XXX > 1 Reliable, Stable and scaleable XXX XXX XXX ? ? > ? > 1 Growth path X XX XX XXX XXX > XX > 1 Error validation and reporting ? X? > ? > 1 Error message separation? ? > ? > 1 Reasonably Fast XXX XXX ? ? ? > X? > 2 Very Fast XX XX ? ? ? > ? > 2 Personalization Engine > X > 2 Source code availabilityX X XX XXX > X > 2 Longevity -- Been aroundXXX XX XX X X > X > 2 Code reusabilityXXX XXX XX > XX > 2 Documentation XXX XXX XX X X > XX > 2 HTML form rich API ? X? ? > 2 Early compilation XXX ? ? > XX > 2 Vendor Freedom X XXX XX XXX XXX > XXX > 2 MVC Pull model ? XXX > ? > 3 MVC Push model ? XXX > XX > 3 Strict API enforcement XXX XXX > XXX > 3 API Extensibility XXX XXX X > XX > 3 Internationalization? X? X? > X > 3 File Upload API ? ? > X? > > I've tried to note what I know exists in each framework. The > legend is as > follows: > X - Feature exists > XX - Feature exists and is reasonably good > XXX - Feature exists and is great > ? - Feature might exist, unsure > X? - Feature exists but quality is unknown > > ASP - IIS, ChiliSoft, Perl::ASP > Straight JSP - See www.javasoft.com > Enhydra - See www.enhydra.org > Struts - See jakarta.apache.org > Turbine - See java.apache.org > XML/XSL - M$ Implements on ASP, Cocoon (java.apache.org), Resin > (www.caucho.com) > > Other priorities relevant to web server, internal process, > etc., but not to > application framework: > Priority - Issue > 1 - Staff Training Resources > 1 - Must run in J2EE environment (Tomcat 3.2) > 1 - Portability, ability to migrate from NT to UNIX easily > 1 - Security > 2 - Easy Deployment > 2 - Logging/audit system > 2 - Ability to debug > 2 - Search > 3 - Voice/WML/Alternate presentation format support > 3 - Reporting system > 4 - Content Management (other than Perforce) > > > > -Origin
db and forms
Hello, If I may I would like to inquire about db/form handling using Struts framework in theoretical point of view. For instance I have 2 tables in my db, let's say "Customers": CustomerID int, Name varchar, Password varchar and "Phones": PhoneIDint, CustomerID int, Number varchar A customer can log on to a web site by specifying his Name and Password on the index page and after that he gets to a main page where he can choose between three links: "view/edit personal information", "view/edit phones" and "add phone". I (almost) understand how to organize logon process: I create a LogonForm.java that represents form elements on the index page and LogonAction.java where I get values from the form and use them to query db to find out if there is such a user and if so I put UserID taken from ResultSet into session and finally load the main page. As I mentioned the main page contains three links which, as I guess, should point to Action Forms, something like "editCustomer.do?Action=Edit", "editPhone.do?Action=Edit" and "editPhone.do?Action=Create". Also I should have jsp pages for creating/editing(viewing) customer and phone information (customer.jsp, phones.jsp (for list of phones) and phone.jsp (for particular phone)). And this is where my poor understanding of overall process ends. What should happen when anyone clicks "editCustomer.do?Action=Edit"? As far as I know I have to create java files like this "CustomerForm.java" and "CustomerAction.java" and perhaps "SaveCustomerAction.java". CustomerForm.java encapsulates data and methods of the form (setter, getter), CustomerAction.java is used to fill in that form (how?) and SaveCustomerAction.java to get data from the form and save them into db, right? Then CustomerAction.java and SaveCustomerAction.java have to contain db related java code where I make use a session element that contains value of CustomerID, right? And what if I need to show some page information of which is based on many ID (parameters)? Should I pass them through URL or Struts offers another way? Well the more I writing the more questions I have and I suppose nobody has time to answer them, but perhaps someone could share couple of his jsp/java files (along with struts-config.xml) that deal with relation db and forms similar to those I tried to describe above. Struts-example it's a good thing but more examples are even better. I would really appreciate any help. Thank you for your time. Best of luck. ___ Do You Yahoo!? Get your free @yahoo.ca address at http://mail.yahoo.ca
Struts, Trubine, Velocity, Expresso
Hi, I recently explored the Struts Application framework features and developed an small application using Struts. Recently I heard about other frameworks like Trubine, Velocity and Expresso. I am really confused about what to choose and what is the difference between these frameworks. Can anybody explain these frameworks and their differences ? Thanks in advance Muhammed Aamir
RE: strange html:form tag
On Wed, 21 Mar 2001, Yuan Jun wrote: > > > > On Tue, 20 Mar 2001, Yuan Jun wrote: > > > > > i download jakarta-struts-1.0-b1 today and found next in > > registration.jsp > > > > > > > > > > > > > > > > > > should it be: > > > > > > or i've missed something? > > > > > > > Although the latter still works, the tag has been made smart > > enough to figure out how an action path is mapped to the controller > > servlet. The former will work even if you change from path mapping to > > extension mapping (or vice versa), for example. > > > > i see. but when i depoyed struts-example to orion 1.4.5, it did work. i have > to modify jsp files adding .do to html:form to make it work, is it a bug of > orion? > It might be. In order for this to work, Struts has to be able to parse the web application deployment descriptor (/WEB-INF/web.xml). To do this, Struts calls: InputStream is = getServletContext().getResourceAsStream("/WEB-INF/web.xml"); At various times Orion has returned null from this call, because the developers incorrectly believed that a servlet should not be able to access resources in the /WEB-INF directory. This has gone back and forth in various Orion versions. Are there any interesting log messages during the startup of the controller servlet? > John Craig
Parallel iteration
Hi folks, I have two ArrayLists that are guaranteed to have the same number of elements. I need to iterate them in parallel, in pseudocode: for (i = 0; ihttp://www.trysoft.com/ e-mail: [EMAIL PROTECTED] Please Note: This document (including attachments) is only intended for the addressee/s and may contain privileged or confidential information. Unauthorised use, copying or distribution of the document or any part of its contents, is prohibited. If you receive this e-mail in error please notify us by return e-mail or telephone. Any views expressed in this Communication are those of the individual sender, except where the sender specifically states them to be the views of Trysoft Corporation Limited. Except as required at law, Trysoft Corporation Limited does not represent, warrant and/or guarantee that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.