Interm page
Greetings, What I wish to develop is an intermediate page after certain actions. For example, one situation would be the user edits and saves changes to a form, in which I wish to take them to a interim page indicating we are processing their action. Once the action is complete the appropriate page is displayed; success (the changes to form is displayed along with a message indicating the changes were saved successfully.) or an error( indicating why the changes were unable to be saved ). Can anyone provide some assistance? Thanx in advance. Biggz
its very strange.
hello all. i found a problem, i am not sure whether its a bug in struts. but i really dont understand why this happened. i created one bean which extended from ActionForm named as ProfileForm. and one variable named as "fName" class final class ProfileForm extends ActionForm { private String fName; public void setFName(String fName) { this.fName = fName; } public String getFName() { return this.fName; } } i got the following error message when i try to access fName property in jsp . "javax.servlet.jsp.JspException: No getter method for property fName of bean org.apache.struts.taglib.html.BEAN" buf if i change the property name to selfName, there are no such kind problem. i am confused. thank in advance. redbeebird
ActionErrors inside perform() methods; application context; and i18n issues
These are three unrelated questions that have arisen as I've learned Struts; I thought I'd lump them together for brevity's sake. I've perused quite a bit of documentation and never found answers to any of these, else I wouldn't resort to spamming the list. 1) While ActionForm.validate() can return some ActionErrors, it seems the only way an action itself can signal an error condition is to forward to an appropriate page--but even in this case, there is no standardized way to return descriptive error information. Might it not make sense to allow actions to somehow associate an ActionErrors with the ActionForward they return, and let the errors become available to the target? That way, an action can perform business logic-related validation from within its perform() method, and simply findForward("input") if it finds some error. Right now, I plan on remedying this by subclassing Action and providing a method which will stuff an ActionErrors into the request (with the appropriate attribute key) and forward to the "input" forward. This mechanism will break whenever someone decides to change the name of the key under which ActionErrors are stored. 2) Is there some way for my lowly Actions to get access to the ServletContext under which they're running? I'd like to be able to get the values of application-context variables. 3) The user guide mentions that sessions may have a Locale associated with them, which will control the ResourceBundle used for things like the tag. But it fails to mention the name of the session key under which the Locale will be stored. Does anybody have an idea what the key is, and if it's subject to change between versions?
Re: Packaging Question - Include Source in Binary Distributions?
On Mon, 23 Apr 2001, Dzenan Ridjanovic wrote: > OK to just point at the download URL for the source distribution if you want > it! +1
struts accessing bean:message tags from somewheres
How can I still get the following error if I've commented all my <%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="WEB-INF/struts-bean.tld" prefix="bean" %> <%@ include file="menubar.js" %> <%@ include file="main.css" %> <% System.out.println("HERE ... " + this.getClass().getClassLoader().getResource("cais.properties"));// ... this show's i'm accessing the right *.properties file %> <%@ include file="header.jsp" %> <%@ include file="mainMenu.jsp" %> <%@ include file="footer.jsp" %>
*** implementing consecutive form validation? ***
If a form is made up of three consecutive pages and I want to validate page by page, how should I go about doing this? Do I use three ActionForms and one Action? Do I use the validation the ActionForm offers for basic validation? Do I fill one ActionForm's validation method with "if/then" statements to test if I am on the first, second, or third page of the form and then use the Action's validate method at the end? I was interested in what you all were implementing. Cheers Jonathan
Struts MessageTag.java not reading property file keys
Yep, I've posted this before, but still can't find the problem. I've dug into the struts code and don't know what's going on here. I'm using Orion 1.4.8 w/ linux 2.2.16. I've got some new info, if I remove my resource file, it's still being found. This after I've just done a fresh install of the server and inside a new account and there are no other resource files in my classpath or on the machine. Can anyone point me to the location where struts is find the resource file, i.e. the path it's using? 500 Internal Server Error javax.servlet.jsp.JspException: Missing message for key main.title at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java,Compiled Code) at /index.jsp._jspService(/index.jsp.java, Compiled Code) at ... According to the above error and this snippit of code taken from the 4-20 tar.gz source, the properties file that my web-app is looking for *is being found* and all seems to be setup/configured correctly, otherwise the error would be about messageTag.resources (not finding the property file). So for some reason, the key can't be gotten from the file. I've also included my properties (cais.properties) file below with this key included in it. The only thing else I think that can be wrong is the value of the args array just before the Exception is thrown and I was wondering if anyone could tell me what those might be. The line with 'String message = resources.getMessage(locale, key, args);' must be returning null and so this is giving me the above error, but I'm not sure what's being stuffed into it or where it comes from. Any help much appreciated. - MessageTag.java public int doStartTag() throws JspException { // Acquire the resources object containing our messages MessageResources resources = (MessageResources) pageContext.getAttribute(bundle, PageContext.APPLICATION_SCOPE); if (resources == null) throw new JspException (messages.getMessage("messageTag.resources", bundle)); // Calculate the Locale we will be using Locale locale = null; try { locale = (Locale) pageContext.getAttribute(localeKey, PageContext.SESSION_SCOPE); } catch (IllegalStateException e) { // Invalidated session locale = null; } if (locale == null) locale = defaultLocale; // Construct the optional arguments array we will be using Object args[] = new Object[5]; args[0] = arg0; args[1] = arg1; args[2] = arg2; args[3] = arg3; args[4] = arg4; // Retrieve the message string we are looking for String message = resources.getMessage(locale, key, args); if (message == null) throw new JspException (messages.getMessage("messageTag.message", key)); -- ~WEB-INF/web.xml action org.apache.struts.action.ActionServlet application cais ... -- ~/index.jsp <%@ page language="java" %><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> -- ~WEB-INF/classes/cais.properties # C.A.I.S. Resource Bundlemain.title=CAISmain.master=Master Viewmain.detail=Detailed View
Error while overriding parameters in instances - components over struts
Hi, I am using components over struts on iAS v 6.0 sp2. I am getting a null pointer exception error while overriding a parameter in an instance. If I don't override and use the instance as is everything work fine. Did anyone else get this error? Thanks for any help/leads. Vijay This is my instance definition in componentInstances.xml And this is how I am overiding the body parameter. <%@ taglib uri="/WEB-INF/components.tld" prefix="comp" %> And this is the layout page <%@ page language="java" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <%@ taglib uri="/WEB-INF/components.tld" prefix="comp" %> <%-- Layout component parameters : title, header, menu, body, footer --%> ERROR: Application resources not loaded -- check servlet container logs for error messages. This is the nullpointer error log session GXLiteSessionID-7637684474562691762 [23/Apr/2001 18:25:49:4] info: -- [23/Apr/2001 18:25:50:8] info: -- [23/Apr/2001 18:25:51:0] info: jsp.APPS.ddts.mainPageContainer: init [23/Apr/2001 18:25:51:2] info: -- java.lang.NullPointerException at s1.struts.taglib.component.PutAttributeTag.putValueInTagParent(PutAtt ributeTag.java:342) at s1.struts.taglib.component.PutAttributeTag.doEndTag(PutAttributeTag.j ava:327) at jsp.APPS.ddts.mainPageContainer._jspService(mainPageContainer.java:79 ) at jsp.APPS.ddts.mainPageContainer.service(mainPageContainer.java:35) at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source) at com.netscape.server.servlet.servletrunner.ServletRunner.callJSP(Unkno wn Source) at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse. callJspCompiler(Unknown Source) at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse. callUri(Unknown Source) at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse. callUriRestrictOutput(Unknown Source) at com.netscape.server.servlet.platformhttp.PlatformRequestDispatcher.fo rward(Unknown Source) at s1.struts.component.ActionComponentServlet.processForward(ActionCompo nentServlet.java:217) at s1.struts.component.ActionComponentServlet.processActionForward(Actio nComponentServlet.java:93) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:156 4) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) at javax.servlet.http.HttpServlet.service(HttpServlet.java:772) at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source) at com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unkno wn Source) at com.kivasoft.applogic.AppLogic.execute(Unknown Source) at com.kivasoft.applogic.AppLogic.execute(Unknown Source) at com.kivasoft.thread.ThreadBasic.run(Native Method) at java.lang.Thread.run(Thread.java:479) java.lang.NullPointerException at s1.struts.taglib.component.PutAttributeTag.putValueInTagParent(PutAtt ributeTag.java:342) at s1.struts.taglib.component.PutAttributeTag.doEndTag(PutAttributeTag.j ava:327) at jsp.APPS.ddts.mainPageContainer._jspService(mainPageContainer.java:79 ) at jsp.APPS.ddts.mainPageContainer.service(mainPageContainer.java:35) at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source) at com.netscape.server.servlet.servletrunner.ServletRunner.callJSP(Unkno wn Source) at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse. callJspCompiler(Unknown Source) at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse. callUri(Unknown Source) at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse. callUriRestrictOutput(Unknown Source) at com.netscape.server.servlet.platformhttp.PlatformRequestDispatcher.fo rward(Unknown Source) at s1.struts.component.ActionComponentServlet.processForward(ActionCompo nentServlet.java:217) at s1.struts.component.ActionComponentServlet.processActionForward(Actio nComponentServlet.java:93) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:156 4) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
RE: iteration enhancement?
I am also interested in this. The IterateTag uses "lengthCount" to keep track of the current iteration, however this is a protected variable and there is no getter to expose it. Would it be possible to put in a public getLengthCount() in the IterateTag? This wouldn't solve Chris's problem directly but then other tags embedded in the IterateTag could then use: findAncestorWithClass(this, IterateTag.class) to get hold of it and then call getLengthCount(). I have two different scenarios where I needed to do this and I've sub-classed IterateTag to achieve it. However it would be really useful if it was in the original version. I have a tag which generates rows with alternating colors which needs this and from various posts I've seen might be useful to quite a few people. It generates elements. Niall > -Original Message- > From: Chris Butler [mailto:[EMAIL PROTECTED]] > Sent: 23 April 2001 16:53 > To: [EMAIL PROTECTED] > Subject: iteration enhancement? > > > Is it possible to access the count of the number of > times you've looped in an tag? > > ideally: > > ># > > > > unfortunately, i'm guessing that via reflection the > bean is created with a reference name and additional > attributes aren't there... > > chris > >
Re: HTML special characters
Doesnt this issue depend on the character encoding? That is, high ascii values (128-255) are control characters in some encodings, which I assume you want to get rid of. Than, there is the 0-31 characters in ascii which are control characters of which you want to get rid of all except tabs, spaces, carriage returns, and line feeds. Than there are characters reserved for private use in other ranges. FYI Macintosh has a 0x0 character which breaks alot of apps, and netscape for mac versions 4.x have a bug which introduces control characters on html form submissions. - Original Message - From: "Craig R. McClanahan" <[EMAIL PROTECTED]> To: "struts-user" <[EMAIL PROTECTED]> Sent: Monday, April 23, 2001 9:48 PM Subject: Re: HTML special characters > > > On Fri, 20 Apr 2001, Peter Alfors wrote: > > > Hello all, > > > > Is there any plan to update the ResponseUtil.filter() method to > > handle more (or all) of the HTML special characters? > > It looks like right now only 4 are being handled. > > > > Thanks, > > Pete > > > > What other characters are you concerned about? The purpose of filtering > was to avoid problems where user data had HTML markup in it, but it wasn't > designed to be a general purpose encoding mechanism. > > Craig > >
Re: Where did the name "struts" originate?
On Fri, 20 Apr 2001, Roxie Rochat wrote: > It's the first question people ask me when I describe > struts and I don't remember seeing its origin explained anywhere. > Is it an acronym or does it refer to the framework part? > Thanks, > Roxie > It originally came from a strong memory from when I had a house built -- there were struts all over the place holding things up. Thus, the idea of a framework that "holds everything up" but is itself invisible was born... Craig
Re: HTML special characters
On Fri, 20 Apr 2001, Peter Alfors wrote: > Hello all, > > Is there any plan to update the ResponseUtil.filter() method to > handle more (or all) of the HTML special characters? > It looks like right now only 4 are being handled. > > Thanks, > Pete > What other characters are you concerned about? The purpose of filtering was to avoid problems where user data had HTML markup in it, but it wasn't designed to be a general purpose encoding mechanism. Craig
Re: & static
On Fri, 20 Apr 2001, Chris Butler wrote: > Another q: > > is it possible to access a static method > [ie. public static getX()] from a bean:write? > > > > seems to throw an exception for me. > i would have guessed that it would work... > although i question what would happen if > you tried to put something in the attribute. > the setX() wouldn't exist... > > Chris > > See the JavaBeans spec. Static methods are not recognized as properties. Craig
Re: Casting beans in JSP
On Fri, 20 Apr 2001, John Raley wrote: > Try using and specifying the type you want. The 'id' > attribute value in will be the downcast reference. > > Example: > <% ... a bean of type Foo is in the page under the attribute name 'aFoo' > %> > > > aSubFoo now refers to aFoo through a reference of type SubFoo. > This works as advertised, but I should point out that if you are only using Struts tags (or to access the properties of the actual bean, casting is not strictly necessary. Craig
RE: No action instance created
On Fri, 20 Apr 2001, Scott Fitzgerald wrote: > > My initial jsp includes: > One thing you should be doing is using the struts-html tag library instead of struts-form. Any bug fixes would only have been applied to the "html" version. Craig
Re: Required vs. optional "name" attribute
Incidentally, can antone tell me the difference between id, name, and property? (org.apache.struts.taglib.bean) - Original Message - From: "James Howe" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, April 23, 2001 12:01 PM Subject: Re: Required vs. optional "name" attribute > At 10:00 PM 4/22/2001 -0700, you wrote: > > > >On Wed, 18 Apr 2001, James Howe wrote: > > > > > I apologize in advance if this topic has come up before, but ... > > > > > > I'm building a Struts JSP page containing a form. I've noticed that the > > > HTML tags typically do not require the specification of a "name" attribute > > > in order to retrieve property values from a bean. If the name isn't > > > specified, the property value is retrieved from the bean associated with > > > the form. However, logic tags require the use of the name attribute in > > > order to retrieve a property. [...] > > > >The HTML-oriented tags that allow you to default the "name" attribute can > >*only* be used within an tag -- they are not useful in any > >other context. > > > >The logic tags (and the bean tags as well) are general purpose tools, > >useful either inside or outside a form. It would be technically feasible > >to do what you suggest, but IMHO it would be very confusing to have the > >same tag do two different things depending on whether you nested it or > >not. > > > >Craig > > > I understand your point. How about if there were a new tag in Struts > called "defaultName" (or something similar). In the defaultName tag, you > could identify a bean which automatically be referred to by all other tags > unless a different bean name attribute were specified on a tag. This would > let you include common code and the common code wouldn't have to know the > name of the bean from which it got its value unless it wanted to. > > > James W. Howe mailto:[EMAIL PROTECTED] > Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html > Ann Arbor, MI 48103 >
Re: getting bean properity in the scriptlet varible
On Fri, 20 Apr 2001, Sundaram Ramasamy wrote: > Hi > > I have collection, I was able to print the message like this. > > > > > > > Is it possible to store the bean value into scriptlet varible. > > > <% > > String name = link.getLinkName(); > > %> > > The type of object created by the iterate tag is determined by the "type" attribute. If you don't include one, it creates a java.lang.Object. If the clas of a "link" object is com.mycompany.MyLink, you could say: Craig
RE: Feature request
On Mon, 23 Apr 2001, Nanduri, Amarnath wrote: > One thing you can do is use a tag which contains the name of the jsp > page. When you submit to the same action, and when you want to show errors > to the input page, get this value out of the tag and forward to that > page. > > I would strongly suggest you use a separate action class for every jsp . > That way it woule be easier to maintain and debug. > If you think all the pages perform almost the same action(s) i would suggest > you use an inheritance mechanism. > You can actually have it both ways ... It is entirely legal to have more than one element that uses the same Action class for the "type" attribute. Then, you still get the benefits of having all the code in one place, but you can also configure the "input" attribute of each individually. If you do this, the standard validation performed by Struts will return to the corret input page, *and* you can do so programmatically from within the common Action by saying: String inputPath = mapping.getInput(); return (new ActionForward(inputPath)); > cheers, > Amar.. > Craig
Re: doing an if-else
There is possibly going to be an If-the-else in the next major release - see release notes, but for now I use equal/notEqual and it works ok for me... Cheers, Keith Please note new extension number/s below... Keith Morrell EDS Consultant, TRAID Project Phone +64-9-308-5650 EDS internal extn 4150 >From Telecom PABX 84150 Fax +64-9-309-8543 Cell +64-21-649-395 Email T906399 (internal) or [EMAIL PROTECTED] >>> [EMAIL PROTECTED] 24/04/01 11:06:15 >>> Hi all, I searched through the archives and could not find a satisfactory answer to the following: There seem to be and tags, but there's no tag. I was looking at Jakarta Taglibs and could not find such a tag either. Does anyone have any idea how to do this without scriptlets? Of course, the 'else' could be something like the tag equivalent of if (x==5) foo; if (x==6) bar; if (x!=5 && x!=6) baz; but that doesn't cut it if you have way too many cases in the else. thanks, Iraklis
Re: doing an if-else
There is possibly going to be an If-the-else in the next major release - see release notes, but for now I use equal/notEqual and it works ok for me... Cheers, Keith Please note new extension number/s below... Keith Morrell EDS Consultant, TRAID Project Phone +64-9-308-5650 EDS internal extn 4150 >From Telecom PABX 84150 Fax +64-9-309-8543 Cell +64-21-649-395 Email T906399 (internal) or [EMAIL PROTECTED] >>> [EMAIL PROTECTED] 24/04/01 11:06:15 >>> Hi all, I searched through the archives and could not find a satisfactory answer to the following: There seem to be and tags, but there's no tag. I was looking at Jakarta Taglibs and could not find such a tag either. Does anyone have any idea how to do this without scriptlets? Of course, the 'else' could be something like the tag equivalent of if (x==5) foo; if (x==6) bar; if (x!=5 && x!=6) baz; but that doesn't cut it if you have way too many cases in the else. thanks, Iraklis
Re: FW: Session scope
On Mon, 23 Apr 2001, Peter Smith wrote: > I'm definitely considering running Struts with at > least 2 JVMs - one on each of 2 boxes. At first I > didn't even consider the effects of running multiple > JVMs - never done it! > > Currently, my company has a big Oracle focus. There's > only one Oracle instance so they're using it to > maintain session info across multiple app servers. > This requires a db hit for every HTTP request. > > I can handle the memory requirements. I just want a > better way to coordinte session info across JVM's. > > In the past I've written a poor-man's 'serialization' > module for PERL which just kicked-out all the > accumulated HTML parameters into tags. > Wonder if I can do something similar for Struts > environment w/o giving up too much of the > functionality I'm using Struts for in the first place. > > Are there any gotchas we can think of with using > Struts across JVM's? > Following the servlet spec requirements (all session attributes need to be Serializable) is the most important issue. Beyond that, it's dependent on the features of the particular app server you are runniing on, so check the docs for yours to identify any platform-specific recommendations. > P.S. I wonder if Tomcat project is planning some kind > of session-sync technology. This is definitely on the list for Tomcat 4.0 development, but I wouldn't hold my breath -- getting this right is going to take a while. Craig
doing an if-else
Hi all, I searched through the archives and could not find a satisfactory answer to the following: There seem to be and tags, but there's no tag. I was looking at Jakarta Taglibs and could not find such a tag either. Does anyone have any idea how to do this without scriptlets? Of course, the 'else' could be something like the tag equivalent of if (x==5) foo; if (x==6) bar; if (x!=5 && x!=6) baz; but that doesn't cut it if you have way too many cases in the else. thanks, Iraklis
RE: File upload problems
Azariah, The first problem you reported might be fixed as of recent builds, please try a nightly build and let me know if it works. As for the multibox issue, I'll definately look into it this week. Thank you -Original Message- From: Azariah Jeyakumar [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 6:11 PM To: '[EMAIL PROTECTED]' Cc: Martin Cooper Subject: File upload problems Hi, We are using the file upload feature of struts heavily. We face the foll problems: 1. I get "java.io.IOException: end of stream before boundary found!" intermittently (full stack trace below). Roughly 1 out of 10 or 20 times I submit the form that contains File upload. I have not been able to identify a pattern when this exception happens. But I think the exception happens only when no file is actually entered/uploaded. To elaborate, my form has several Submit buttons. Only 1 of the submit button expects the type=file field to have a valid file name. All other submit buttons dont care about the field. When I click on one of these other submit buttons, I get the above exception, intermittently. 2. The tag struts:multibox does not work well in a form that has enctype=multipart/form-data. Only the last checkbox that I selected is set in the multibox form field. I expect a comma separated list of the value of all the selected checkboxes. This works in the form if I remove the enctype attribute. We use jakarta-struts-1.0-b1. Thanks Azariah Full stack trace for first problem: 500 Servlet Exception java.io.IOException: end of stream before boundary found! at org.apache.struts.upload.MultipartValueStream.(MultipartValueStream.ja va:65) at org.apache.struts.upload.MultipartIterator.createLocalFile(MultipartIterator .java:469) at org.apache.struts.upload.MultipartIterator.getNextElement(MultipartIterator. java:201) at org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti partRequestHandler.java:70) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:447) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:19 10) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1521) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) at javax.servlet.http.HttpServlet.service(HttpServlet.java:115) at javax.servlet.http.HttpServlet.service(HttpServlet.java:83) at com.caucho.server.http.Invocation.service(Invocation.java:291) at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:121) at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:333) at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:266 ) at com.caucho.server.TcpConnection.run(TcpConnection.java:140) at java.lang.Thread.run(Thread.java:484)
RE: FW: Session scope
Application server level load balancing is the answer to the problem. I don't see there is a strong reason to synchronize two sessions on two different app servers. Because the web server or proxy server will establish the link between the client and app server the very first time the connection is made. After that, the client (browser) will bind to the same app server. So, session info should only be kept in that particular app server. However, if you want to do session level fail-over, then like Weblogic app server, you will utilize their cluster feature to sync the secondary app server with the primary app server in case the primary is down. This requires to use BEA's weblogic proxy feature to detect such failure of primary app server down. In current generation of web apps, should any services is needed to be distributed, you can use EJB, RMI, CORBA or COM/COM+. Session related info should be in the memory of app server. Session is transient, not persistent. Yong Chen -Original Message- From: Peter Smith [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 5:38 PM To: [EMAIL PROTECTED] Subject: Re: FW: Session scope I'm definitely considering running Struts with at least 2 JVMs - one on each of 2 boxes. At first I didn't even consider the effects of running multiple JVMs - never done it! Currently, my company has a big Oracle focus. There's only one Oracle instance so they're using it to maintain session info across multiple app servers. This requires a db hit for every HTTP request. I can handle the memory requirements. I just want a better way to coordinte session info across JVM's. In the past I've written a poor-man's 'serialization' module for PERL which just kicked-out all the accumulated HTML parameters into tags. Wonder if I can do something similar for Struts environment w/o giving up too much of the functionality I'm using Struts for in the first place. Are there any gotchas we can think of with using Struts across JVM's? P.S. I wonder if Tomcat project is planning some kind of session-sync technology. --- "Maguire, James" <[EMAIL PROTECTED]> wrote: > Obviously, design decisions have been made on the > session context. > > Is anyone running (or considering running) Struts in > a truly distributed > server infrastructure? > Does Craig's suggestion of Serializable session > beans stand up under volume? > > Just looking for some pointers. > > Jim > > -Original Message- > From: Craig R. McClanahan > [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 13, 2001 11:03 PM > To: Struts-User@Jakarta. Apache. Org (E-mail) > Subject: Re: Session scope > > > > > On Tue, 10 Apr 2001, Girish Baxi wrote: > > > I am a new strut user as far as i know , isnt > it a bad idea to store > > data in the session scope simply becoz its not > scalable for a multiple web > > server scenario ... > > is there any work around to using session scope in > case of form beans that > > span more than one html page ??? > > > > any guidance is appreciated, > > thanx > > > > > > > > Let's understand what is really happening in order > to understand what the > potential impacts are: > > * An HttpSession, as implemented by your servlet > container, typically > uses something like a Hashtable or a HashMap to > store session > attributes. > > * When you create a bean instance, the bytecodes > that make up the > executable methods of your bean are shared across > all instances -- the > only thing that takes memory is the bean > properties themselves. > > * Let's assume that your bean uses about 1000 bytes > for the properties > that are unique to that bean, and you want to save > a bean in each > user's session because it represents information > you need over more > than one request. > > * If you have 10,000 simultaneous users, that means > you need roughly > ten megabytes (10,000 * 1000) of memory to store > these objects. Whether > that is a problem or not depends on how much free > memory you have. > > * Some application servers support load balancing > and distribution > facilities, so that they can handle more users > than can be supported > by a single server. Essentially, they are running > a copy of your > web application on each server. In order to > facilitate migrating > your session from one server to another, they may > require you to make > all of your session beans Serializable. > > The bottom line is that, like everything else, use > of session beans > involves tradeoffs. If you are running amazon.com > or Yahoo, you care a > lot about memory occupancy. If you're writing an > Intranet app for 50 > users in your department, it's probably not a big > deal unless you have > very large data objects to be stored. You should > analyze your expected > simultaneous user counts, and the typical amount of > memory that their > session attributes require. Compare that to the > amount of available > memory on your server. T
RE: Where did the name "struts" originate?
Robert, Many thanks for how to narrow my search. The mail-archive.com archives only go back as far as the beginning of this year and the covalent.net link from the struts "Resources" page never seems to work. Is this a temporary thing or is this site permanently off-line now? In any event, it would be nice to have this information on the struts website somewhere. Roxie -Original Message- From: Robert Leland [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 21, 2001 9:29 PM To: [EMAIL PROTECTED] Subject: Re: Where did the name "struts" originate? Search the mail archive www.mail-archive.com I recall Craig answering that question back in October/November 2000. I thought it ment the struts of a airplane but that wasn't where the name came from. Roxie Rochat wrote: > > It's the first question people ask me when I describe > struts and I don't remember seeing its origin explained anywhere. > Is it an acronym or does it refer to the framework part? > Thanks, > Roxie -- Robert Leland [EMAIL PROTECTED] 804 N. Kenmore Street +01-703-525-3580 Arlington VA 22201
Re: Where did the name "struts" originate?
http://marc.theaimsgroup.com/?l=struts-user&m=96946875918003&w=2
Re: FW: Session scope
I'm definitely considering running Struts with at least 2 JVMs - one on each of 2 boxes. At first I didn't even consider the effects of running multiple JVMs - never done it! Currently, my company has a big Oracle focus. There's only one Oracle instance so they're using it to maintain session info across multiple app servers. This requires a db hit for every HTTP request. I can handle the memory requirements. I just want a better way to coordinte session info across JVM's. In the past I've written a poor-man's 'serialization' module for PERL which just kicked-out all the accumulated HTML parameters into tags. Wonder if I can do something similar for Struts environment w/o giving up too much of the functionality I'm using Struts for in the first place. Are there any gotchas we can think of with using Struts across JVM's? P.S. I wonder if Tomcat project is planning some kind of session-sync technology. --- "Maguire, James" <[EMAIL PROTECTED]> wrote: > Obviously, design decisions have been made on the > session context. > > Is anyone running (or considering running) Struts in > a truly distributed > server infrastructure? > Does Craig's suggestion of Serializable session > beans stand up under volume? > > Just looking for some pointers. > > Jim > > -Original Message- > From: Craig R. McClanahan > [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 13, 2001 11:03 PM > To: Struts-User@Jakarta. Apache. Org (E-mail) > Subject: Re: Session scope > > > > > On Tue, 10 Apr 2001, Girish Baxi wrote: > > > I am a new strut user as far as i know , isnt > it a bad idea to store > > data in the session scope simply becoz its not > scalable for a multiple web > > server scenario ... > > is there any work around to using session scope in > case of form beans that > > span more than one html page ??? > > > > any guidance is appreciated, > > thanx > > > > > > > > Let's understand what is really happening in order > to understand what the > potential impacts are: > > * An HttpSession, as implemented by your servlet > container, typically > uses something like a Hashtable or a HashMap to > store session > attributes. > > * When you create a bean instance, the bytecodes > that make up the > executable methods of your bean are shared across > all instances -- the > only thing that takes memory is the bean > properties themselves. > > * Let's assume that your bean uses about 1000 bytes > for the properties > that are unique to that bean, and you want to save > a bean in each > user's session because it represents information > you need over more > than one request. > > * If you have 10,000 simultaneous users, that means > you need roughly > ten megabytes (10,000 * 1000) of memory to store > these objects. Whether > that is a problem or not depends on how much free > memory you have. > > * Some application servers support load balancing > and distribution > facilities, so that they can handle more users > than can be supported > by a single server. Essentially, they are running > a copy of your > web application on each server. In order to > facilitate migrating > your session from one server to another, they may > require you to make > all of your session beans Serializable. > > The bottom line is that, like everything else, use > of session beans > involves tradeoffs. If you are running amazon.com > or Yahoo, you care a > lot about memory occupancy. If you're writing an > Intranet app for 50 > users in your department, it's probably not a big > deal unless you have > very large data objects to be stored. You should > analyze your expected > simultaneous user counts, and the typical amount of > memory that their > session attributes require. Compare that to the > amount of available > memory on your server. The results of this > comparison will tell you how > much (or little) you need to worry about the amount > of space session > variables require. > > Craig McClanahan > > __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
File upload problems
Hi, We are using the file upload feature of struts heavily. We face the foll problems: 1. I get "java.io.IOException: end of stream before boundary found!" intermittently (full stack trace below). Roughly 1 out of 10 or 20 times I submit the form that contains File upload. I have not been able to identify a pattern when this exception happens. But I think the exception happens only when no file is actually entered/uploaded. To elaborate, my form has several Submit buttons. Only 1 of the submit button expects the type=file field to have a valid file name. All other submit buttons dont care about the field. When I click on one of these other submit buttons, I get the above exception, intermittently. 2. The tag struts:multibox does not work well in a form that has enctype=multipart/form-data. Only the last checkbox that I selected is set in the multibox form field. I expect a comma separated list of the value of all the selected checkboxes. This works in the form if I remove the enctype attribute. We use jakarta-struts-1.0-b1. Thanks Azariah Full stack trace for first problem: 500 Servlet Exception java.io.IOException: end of stream before boundary found! at org.apache.struts.upload.MultipartValueStream.(MultipartValueStream.ja va:65) at org.apache.struts.upload.MultipartIterator.createLocalFile(MultipartIterator .java:469) at org.apache.struts.upload.MultipartIterator.getNextElement(MultipartIterator. java:201) at org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti partRequestHandler.java:70) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:447) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:19 10) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1521) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) at javax.servlet.http.HttpServlet.service(HttpServlet.java:115) at javax.servlet.http.HttpServlet.service(HttpServlet.java:83) at com.caucho.server.http.Invocation.service(Invocation.java:291) at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:121) at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:333) at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:266 ) at com.caucho.server.TcpConnection.run(TcpConnection.java:140) at java.lang.Thread.run(Thread.java:484)
Struts at JavaOne
If you're planning to come to JavaOne this year, you might want to make a point of attending the following presentations that I'm giving, with Struts being featured content: BOF #1289 - "The Struts Framework Community" Wednesday, June 6, 9-9:50pm TS #1284 - "Recommendations for Web Application Architectures" Thursday, June 7, 12:15-1:15pm And if you're also interested in Tomcat or user authentication (or you just want to hear me talk some more :-), you might also want to note the following: TS #1287 - "The Tomcat Servlet Container" (focus on Tomcat 4.0) Wednesday, June 6, 12:15-1:15pm BOF #1290 - "The Tomcat Community" Wednesday, June 6, 8-8:50pm BOF #1291 - "Approaches to User Authentication and Access Control in Web Applications" Thursday, June 7, 7-7:50pm Craig McClanahan
RE: "No getter method for property {prop} of bean {bean}"
I also was getting the same error that the getter method of my property couldn't be found. The difference though is that I'm not using overloading. Here's what I had: // - Attributes - private Calendar formDate = Calendar.getInstance(); // -- Properties - public void setFormDate(Date _last_mod_time) { formDate.setTime(_last_mod_time); } public Calendar getFormDate() { return formDate; } I couldn't find out why it wouldn't find my getter method. All my other properties worked just fine. At some point I just switched the order of the get and set method and it mysteriously worked. Here's how I have it now in my class: // - Attributes - private Calendar formDate = Calendar.getInstance(); // -- Properties - public Calendar getFormDate() { return formDate; } public void setFormDate(Date _last_mod_time) { formDate.setTime(_last_mod_time); } Although I don't know why I'm very happy that it works now. Does anybody know why this phenomena occurs? Regards, Martin -Original Message- From: Anthony Martin [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 10:00 AM To: '[EMAIL PROTECTED]' Subject: RE: "No getter method for property {prop} of bean {bean}" Ok, I figured out a work-around. The bean properties must not be overloaded I guess. I created some setter properties that modify the same instance variables but under a different name (signatures are as follows): protected Date createDt ; String getCreateDt() void setCreateDtAsDate ( Date ) That way the internal systems can pass the correct data type to the variable. To the form, the property is read-only. To the internal system, it's write-only. The String getter value "magically" changes when the Date setter value is changed. I know this may not follow with bean specifications, but doesn't this sound strangely similar to method overloading? Anthony -Original Message- From: Anthony Martin [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 9:03 AM To: '[EMAIL PROTECTED]' Subject: "No getter method for property {prop} of bean {bean}" I get the ServletException, "No getter method for property {prop} of bean {bean}" when accessing this particular bean. The variable instance is stored as a Date that I format to and from strings. The setter can take a Date or a String. I could understand if it couldn't find the setter, but I don't understand why it can't find the getter. Is this caused by the fact that I have overloaded the setter to accept Date? I want to have "createDt" and "modifyDt" values that are set by the system. I should be able to drop the String setter all together so that my UI team won't be tempted to offer it as an editable field. Or am I taking the wrong approach? Anthony It is by caffeine alone I set my mind in motion. It is by the Beans of Java that thoughts acquire speed, the hands acquire shaking, the shaking becomes a warning. It is by caffeine alone I set my mind in motion.
destroy the ActionForm object.
Title: destroy the ActionForm object. Hi, Is anybody knows how Struts clean up object like ActionForm? can we program to control the clean up this object explicitly? also, can i put ActionForm into the session container that i create where i uses it to store proxies to session? Any idea is welcome. Thanks. See-Yam Lim [EMAIL PROTECTED]
Re: Packaging Question - Include Source in Binary Distributions?
OK to just point at the download URL for the source distribution if you want it! "Craig R. McClanahan" wrote: > As we move towards a 1.0 release of Struts (really! :-), one of the > things I am cleaning up is the way that binary distributions are > packaged. Currently, we follow the typical Jakarta pattern of including > the source code for Struts in the binary distribution (in the "etc", > "src", and "web" directories), as well as in a separate download. > > My question is, do people find the fact that the binary distribution > includes source code useful, or would it be OK to just point you at the > download URL for the source distribution if you want it? For recent > builds, this would cut the size of the binary distribution by about one > third. > > I'm fine with doing it either way, but wanted to get some feedback from > the community before making a final decision. > > Craig -- Dzenan Ridjanovic http://drdb.fsa.ulaval.ca/
Re: Who, what, where, how and why?
On Mon, 23 Apr 2001, Ted Husted wrote: > < http://www.husted.com/about/struts/kickstart.html > > > might interest you. > > There are well over 1000 subscribers to this list. > As of this morning, we're up to 1222 subscribers. Craig
RE: Packaging Question - Include Source in Binary Distributions?
Hi Craig, IMHO the source code is useful, at least in the following circumstances: 1) some weird error occurs (because a struts user writes bad code), and the line numbers for a file are given. Sometimes looking at the source helps understand what the heck is going on in your own code and how to fix it. 2) The source for the struts-example sample application (although not part of the source code you're likely talking about) was to me the most useful resource in understanding Struts. Any other example I found on the web was highly confusing and/or incomplete (including the 'resources' section of the Jakarta Struts home page.) In either case though, as long as the code is still downloadable there won't be any problem. my 2 cents, Iraklis -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 3:31 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Packaging Question - Include Source in Binary Distributions? As we move towards a 1.0 release of Struts (really! :-), one of the things I am cleaning up is the way that binary distributions are packaged. Currently, we follow the typical Jakarta pattern of including the source code for Struts in the binary distribution (in the "etc", "src", and "web" directories), as well as in a separate download. My question is, do people find the fact that the binary distribution includes source code useful, or would it be OK to just point you at the download URL for the source distribution if you want it? For recent builds, this would cut the size of the binary distribution by about one third. I'm fine with doing it either way, but wanted to get some feedback from the community before making a final decision. Craig
Re: Packaging Question - Include Source in Binary Distributions?
I like having the source with the binary distribution. I would just download both if they were separate. David --- "Craig R. McClanahan" <[EMAIL PROTECTED]> wrote: > As we move towards a 1.0 release of Struts (really! > :-), one of the > things I am cleaning up is the way that binary > distributions are > packaged. Currently, we follow the typical Jakarta > pattern of including > the source code for Struts in the binary > distribution (in the "etc", > "src", and "web" directories), as well as in a > separate download. > > My question is, do people find the fact that the > binary distribution > includes source code useful, or would it be OK to > just point you at the > download URL for the source distribution if you want > it? For recent > builds, this would cut the size of the binary > distribution by about one > third. > > I'm fine with doing it either way, but wanted to get > some feedback from > the community before making a final decision. > > Craig > > __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
RE: Load Testing
The jmeter list said something about that being fixed in the CVS version. >From the jmeter list: This is the case in JMeter 1.5. In 1.6, the alpha release doesn't allow alternate ports. However, it has been fixed in cvs. -Mike On Monday 09 April 2001 19:07, you wrote: > Yep, you just have to specify the port # in the URL, like this: > http://localhost:8080/, the browser chooses 80 by default unless you tell > it which port to look at. > > -- end of snippet from jmeter list > -Original Message- > From: Ted Husted [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 23, 2001 4:28 PM > To: [EMAIL PROTECTED] > Subject: Re: Load Testing > > > Were you able to get that running with an alternate port, like 8080 ? > > "Deadman, Hal" wrote: > > Microsoft has a free stress test tool too: > > http://homer.rte.microsoft.com/ >
Packaging Question - Include Source in Binary Distributions?
As we move towards a 1.0 release of Struts (really! :-), one of the things I am cleaning up is the way that binary distributions are packaged. Currently, we follow the typical Jakarta pattern of including the source code for Struts in the binary distribution (in the "etc", "src", and "web" directories), as well as in a separate download. My question is, do people find the fact that the binary distribution includes source code useful, or would it be OK to just point you at the download URL for the source distribution if you want it? For recent builds, this would cut the size of the binary distribution by about one third. I'm fine with doing it either way, but wanted to get some feedback from the community before making a final decision. Craig
Re: How can i integrate struts with cocoon ?
On Sun, 22 Apr 2001 17:13:52 +0200, "M.Amin" <[EMAIL PROTECTED]> wrote: > Dear all, > I'm a newbie to struts-velocity framework and i want to integrate the forms > generated by struts with the other xml files generated under cocoon control. > My question is : is it possible to integrate struts with cocoon ? I believe we need to add a JSP generator to Cocoon to be able to use Struts. This is true for any JSP taglib out there. The JSP generator would pretty much work the same as XSP, except that it has to accept the JSP syntax. Regards, -- Ovidiu Predescu <[EMAIL PROTECTED]> http://orion.nsr.hp.com/ (inside HP's firewall only) http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff) Did you miss my presentation, "Using Cocoon to build Web sites for wireless devices" at ApacheCon 2001 in Santa Clara, CA? You can still get my presentation on the Web at: http://www.geocities.com/SiliconValley/Monitor/7464/apachecon-2001/
Re: Load Testing
Were you able to get that running with an alternate port, like 8080 ? "Deadman, Hal" wrote: > Microsoft has a free stress test tool too: > http://homer.rte.microsoft.com/
Re: Load Testing
On Mon, 23 Apr 2001, Ted Husted wrote: > One question for any Linux gurus -- I'll try and max this out and see > for myself, but does anyone know what scale "uptime" uses for the load, > and where performance trails off. It starts at 0.00 -- and goes to > 100.00? uptime shows you the average number of processes that are in the 'runnable' state for the various time periods (1, 5, 15 minutes). So, for uniprocessor machines, a load factor of 1 might be considered high (depending on how seriously you take those engineering safety factor calculations), while for a 4 processor SMP machine, a load factor of one would indicate you were only using a quarter of the machine (more or less). Of course, the whole load factor number discussion is somewhat simplified and things other than cpu load can impact the ability of the machine to respond to any given request (interrupts, paging, etc). Note that I am not a linux guru, but I have played one on TV. Owen -- USMail: CareerSite Corporation, 310 Miller Avenue, Ann Arbor, MI 48103 Phone:+1 734 213-9500 FAX:+1 734 213-9011 mailto:[EMAIL PROTECTED] http://www.careersite.com/~osm/
Re: Load Testing
I'm trying jmeter, and it seems useful, especially in conjunction with manual testing, but I'm still finding my way around. It has a feature for HTTP authentication, but I'm doing it myself. I may need to setup a test action for some allows someone to login and bid at the same time (it's an auction application -- also destined to be open source, BTW). One question for any Linux gurus -- I'll try and max this out and see for myself, but does anyone know what scale "uptime" uses for the load, and where performance trails off. It starts at 0.00 -- and goes to 100.00? "Deadman, Hal" wrote: > > I assume you have you looked at Jmeter? http://jakarta.apache.org/jmeter I > haven't used it yet. I am not sure how easy it is to generate load that > consists of dynamically generated data for form submissions and the like. > > Microsoft has a free stress test tool too: > http://homer.rte.microsoft.com/ > > I need to do some load testing on a Struts application, and > > wondered if > > anyone had any war stories to share, or recommendations as to the best > > approach.
String[]
I am trying to use where the getter and setter if field work with String[]. Is this the correct approach? Is this functionality available? Anthony It is by caffeine alone I set my mind in motion.It is by the Beans of Java that thoughts acquire speed,the hands acquire shaking, the shaking becomes a warning.It is by caffeine alone I set my mind in motion.
RE: Load Testing
I assume you have you looked at Jmeter? http://jakarta.apache.org/jmeter I haven't used it yet. I am not sure how easy it is to generate load that consists of dynamically generated data for form submissions and the like. Microsoft has a free stress test tool too: http://homer.rte.microsoft.com/ > -Original Message- > From: Ted Husted [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 23, 2001 12:48 PM > To: [EMAIL PROTECTED] > Subject: Load Testing > > > I need to do some load testing on a Struts application, and > wondered if > anyone had any war stories to share, or recommendations as to the best > approach. > > -- Ted Husted, Husted dot Com, Fairport NY USA. > -- Custom Software ~ Technical Services. > -- Tel 716 737-3463. > -- http://www.husted.com/about/struts/ >
Calendar
does anyone have any clever ways to deal with bean Calendar properties via JSP? a string would be nicer... chris
Struts Performance
Hello all, I am writing a struts application with iPlanet that uses internationalization. I am seeing some performance problems. Before I go down the road too far to pull out, has anyone else seen performance problems with internationalization with struts? How performant is struts in a production environment? -- Jason Smith [EMAIL PROTECTED]
Re: Who are using Struts? (we are reply)
We are but unfortunately it is not availble to the public... Regards, Please note new extension number/s below... Keith Morrell EDS Consultant, TRAID Project Phone +64-9-308-5650 EDS internal extn 4150 >From Telecom PABX 84150 Fax +64-9-309-8543 Cell +64-21-649-395 Email T906399 (internal) or [EMAIL PROTECTED]
Re: Who, what, where, how and why?
< http://www.husted.com/about/struts/kickstart.html > might interest you. There are well over 1000 subscribers to this list. Thomas Peters wrote: > > Looking into struts... > > I am interested in getting information on who is using struts. Is this > framework well adopted? > I'd like to know what type of applications are being developed & who is > developing them. > Additionally, what is the approximate size of the developer community? > > Thank you.
Multi-Lingual collections with Struts HTML tags?
Hello, I created a GetCodeTable Tag that loads data from a database table into a collection. This way I can re-use struts html tags... Great! But now I want to support two languages: english_description and french_description Do I have create a new tag, extend it from the Struts OptionsTag to allow this: Or is there a cleaner way to do this? Thanks in advance. Mario L.
Help with upload
Hi, I'm trying to get the file upload facility to work, and am having trouble. I can get a file to upload and get stored in the database, but as soon as I forward to the next page (through a forward to an action), I get an exception: "javax.servlet.ServletException: MultipartIterator: no multipart request data sent". Tomcat claims to be working on the next action by that time (a listing of all the attachments stored in the database). Any idea why I might be getting this? I realize that I'm not providing all that much information, but maybe it's a common occurrence if you don't have things set up right...? Thanks for any help. Email me direct if you like - I receive the digest version of the list. Chris Campbell
Who, what, where, how and why?
Looking into struts... I am interested in getting information on who is using struts. Is this framework well adopted? I'd like to know what type of applications are being developed & who is developing them. Additionally, what is the approximate size of the developer community? Thank you. -Original Message- From: Thomas Peters [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 12:34 PM To: [EMAIL PROTECTED] Subject: RE: Is there something wrong? I see no content in any of the messages... -Original Message- From: Chris Butler [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 11:53 AM To: [EMAIL PROTECTED] Subject:
Load Testing
I need to do some load testing on a Struts application, and wondered if anyone had any war stories to share, or recommendations as to the best approach. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/
RE:
Is there something wrong? I see no content in any of the messages... -Original Message- From: Chris Butler [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 11:53 AM To: [EMAIL PROTECTED] Subject:
Re: Required vs. optional "name" attribute
At 10:00 PM 4/22/2001 -0700, you wrote: >On Wed, 18 Apr 2001, James Howe wrote: > > > I apologize in advance if this topic has come up before, but ... > > > > I'm building a Struts JSP page containing a form. I've noticed that the > > HTML tags typically do not require the specification of a "name" attribute > > in order to retrieve property values from a bean. If the name isn't > > specified, the property value is retrieved from the bean associated with > > the form. However, logic tags require the use of the name attribute in > > order to retrieve a property. [...] > >The HTML-oriented tags that allow you to default the "name" attribute can >*only* be used within an tag -- they are not useful in any >other context. > >The logic tags (and the bean tags as well) are general purpose tools, >useful either inside or outside a form. It would be technically feasible >to do what you suggest, but IMHO it would be very confusing to have the >same tag do two different things depending on whether you nested it or >not. > >Craig I understand your point. How about if there were a new tag in Struts called "defaultName" (or something similar). In the defaultName tag, you could identify a bean which automatically be referred to by all other tags unless a different bean name attribute were specified on a tag. This would let you include common code and the common code wouldn't have to know the name of the bean from which it got its value unless it wanted to. James W. Howe mailto:[EMAIL PROTECTED] Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html Ann Arbor, MI 48103
iteration enhancement?
Is it possible to access the count of the number of times you've looped in an tag? ideally: # unfortunately, i'm guessing that via reflection the bean is created with a reference name and additional attributes aren't there... chris
RE: Who are using Struts?
Hello, Sites that are known to be Powered by Struts are given at this site. http://husted.com/about/struts/kickstart.html#powered Regards, Ravindranath P. -Original Message- From: Suriyanarayanan, Senthil Kumar [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 7:00 PM To: [EMAIL PROTECTED] Subject: Who are using Struts? Hello, I wonder if anyone can provide me the list of few sites currently using Struts as their part of Presentation Framework. 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: Iterate over a bean full of beans?
as far as i know you can have nested iterate tags: i think the trick is referencing the page scope var you've created in the outer iterate... in this case "outerObj". chris At 09:42 PM 4/23/2001 +0700, Gael Laurans wrote: From: "Keith Morrell" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Iterate over a bean full of beans? Date: Mon, 23 Apr 2001 17:12:57 +1200 I have an issue where I want to iterate using a bean which has "child" beans (excuse the non-industry standard lingo!) and would appreciate some advice (sorry this is my third post today, but I have been struggling with this and a couple of other issues for days now..) The old code went something like: <% Iterator it = Summary.getAccounts().iterator(); if(it.hasNext()) ... and then within this loop, <% while( it.hasNext() ) { AccountBean ab = (AccountBean) it.next(); out.println( ab.getName(); out.println( ab.getPhone(); ... etc... Any help etc would be appreciated...as i am not sure how to access the child bean properties etc from the main bean (which would control the iterate loop) Here is what I am doing : I have a Bean with a vector field... public class SearchResult implements Serializable { private Vector lots = new Vector(); ... and a method returning an array of the vector's elements ... public Lot[] getLots() { Lot[] results = new Lot[lots.size()]; lots.copyInto(results); return results; } In the JSP I can use the iterate tag as follow : ... ... Hope this helps Gael Laurans _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Re: Iterate over a bean full of beans?
>From: "Keith Morrell" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: [EMAIL PROTECTED] >Subject: Iterate over a bean full of beans? >Date: Mon, 23 Apr 2001 17:12:57 +1200 > >I have an issue where I want to iterate using a bean which has "child" >beans (excuse the non-industry standard lingo!) and would appreciate >some advice (sorry this is my third post today, but I have been >struggling with this and a couple of other issues for days now..) > >The old code went something like: > ><% Iterator it = Summary.getAccounts().iterator(); > if(it.hasNext()) > >... and then within this loop, > ><% while( it.hasNext() ) >{ > AccountBean ab = (AccountBean) it.next(); > out.println( ab.getName(); > out.println( ab.getPhone(); > >... etc... > >Any help etc would be appreciated...as i am not sure how to access the >child bean properties etc from the main bean (which would control the >iterate loop) > Here is what I am doing : I have a Bean with a vector field... public class SearchResult implements Serializable { private Vector lots = new Vector(); ... and a method returning an array of the vector's elements ... public Lot[] getLots() { Lot[] results = new Lot[lots.size()]; lots.copyInto(results); return results; } In the JSP I can use the iterate tag as follow : ... ... Hope this helps Gael Laurans _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Re: indicating mandatory input fields in html form?
Phillip, Just keep in mind that some users may be color-blind. Using an asterisk or some other method of making the string itself look different will solve that. As craig mentioned, whatever you choose, it is a good idea to let the user know what the change means. Pete "Craig R. McClanahan" wrote: > On Wed, 18 Apr 2001, Phillip Rhodes wrote: > > > Is there a recommended method for indicating a required field in an html > > input form? > > > > I know I can just type an asterisk in, but isn't there a better way? > > > > Thanks. > > Phillip > > > > > > I don't know if it is "better", but I've seen web sites that use a > different colored prompt for required fields versus optional > fields. Whatever convention you use, be sure that you tell the user about > it :-), and use it consistently on all of your forms. > > 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
Who are using Struts?
Hello, I wonder if anyone can provide me the list of few sites currently using Struts as their part of Presentation Framework. 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: Cookies and Clusters (Cookies)
I will reply to Malcolm Davis in two parts: Cookies, then (later) Clusters: Cookies: Yes, my presentation of the DHTML and JS stuff was a bit confusing. And unnecessary. Let me boil it down. What I was musing about was a hack (??) I had just seen in a non-Struts MVC app whereby the current page gets updated, in situ, through the cookie(s) that head-up an SC_NO_CONTENT page just sent from the server. The JavaScript in the current page reads the cookie(s) and updates its own document model. No screen flash. Very smooth. A nice MVC screen effect. Think of the Color Chooser, the canonical MVC application. Smooth updates. Is it a hack? Would we consider such a technique for Struts? Of course, having the client code read cookies might be considered weird. But why not. This is the web. We survived the frameset mish-mash. Many B2B apps have captive clients on dedicated PCs. If the app wants cookies, he should get cookies, right? These are session cookies, not persistent cookies. Privacy is not a big concern. If the browser is loading up on cookies from other apps and maxes out, he gets a nice warning to quit screwing around. I did not write this MVC-ish app that I am talking about. I am merely testing it, aggresively, looking for hacks. I don't have access to the servlet code but I can see the cookies arriving at the browser. No JSESSIONID there. Just 4k of encoded state. You ask, does this app use HttpSession? Apparently not. It bakes its own cookies, complex cookies. Bad. Bad. Bad. But I like it. It contributes to MVC. Why not do it, do it, do it?? - Original Message - From: malcolm davis To: [EMAIL PROTECTED] Sent: Monday, April 23, 2001 1:47 AM Subject: RE: Cookies and Clusters Dan, > Cookies get a lot of bad press. But, cookies (or complex URL encoding) are the fall-back > when session beans are not going to be used. Many JSP developers will shun session > beans because the app might get deployed on clustered servers (reverse proxied). > Each POST might then be dispatched to a different JVM. Session beans were not shared > correctly among clustered JVMs until Servlet 2.3. (Correct me if I am wrong.) > Nobody is there yet in the commercial offerings. iPlanet does, and I'm sure other vendors do also. I'm a little lost here about the DHTML & JS stuff, but you might have a misunderstanding about cookies. You can turn cookies off in the browser, but the Appserver should implement them via the jsessionid. Cookies are fine for a cluster environment. The servlets must be marked as sticky, meaning each subsequent request will return to the correct JVM. Of course, this might depend on the Appserver being used, and how your cluster is configured.At my present job, we have 3 machines running 10 JVM’s, a total of 30 JVM’sin the cluster. If your not using session beans, are you using HttpSession? - malcolm
RE: Feature request
One thing you can do is use a tag which contains the name of the jsp page. When you submit to the same action, and when you want to show errors to the input page, get this value out of the tag and forward to that page. I would strongly suggest you use a separate action class for every jsp . That way it woule be easier to maintain and debug. If you think all the pages perform almost the same action(s) i would suggest you use an inheritance mechanism. cheers, Amar.. -Original Message- From: alex [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 2:26 AM To: [EMAIL PROTECTED] Subject: Re: Feature request hi all. i wonder who can help me resolve this problem. i am making a program based on struts. there are some circumstances that serval pages invoke one same action. and if some errors occured i want to show these errors in the previous page, but i cannot judge where the page is, cuz, there are many pages can invoke this action. thanks alot redbeebird.
Which nightly build to use?
Hello I've been working under Struts 1.0b1 for awhile, and would like to catch up. I see that the last binary distribution update was on 4/18, while the source distribution was updated last night. Does this mean there have been only doc changes for a few days? Which set of binary and source are recommended just now? Thanks in advance. -- Tom Miller Miller Associates, Inc. [EMAIL PROTECTED] 641.469.3535 Phone 413.581.6326 FAX
Nighly build corrupt
Am I wrong or are the nighly binary distributions corrupt? When I look into http://jakarta.apache.org/builds/jakarta-struts/nightly all binary distributions since 20010419 is 1 Kb in size! Maybe the coders have been very efficient :-) Nightly source distributions seems to have the right size, but the binaries are much more convenient for a none struts source developer. Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices
RE: Digester :"java.lang.InternalError: (Ex02) An error has occu rred " AND"addCallParam"
Craig, >Could you describe the exact rules you are trying to use? It's not >possible to answer your questions just from this description. >Craig Here are the rules I use for my case : digest.push(this); digest.addObjectCreate("connector/config", "java.lang.Exception", "configClassName"); digest.addSetProperty("connector/config/attribute", "name", "value"); digest.addSetNext("connector/config", "setConfigObject", "java.lang.Object"); // New object reference is stored in current object (this) in order to be available after automatical pop digest.addCallMethod("connector", "addConnectorToList", 1); // Function call at end tag digest.addCallParam("connector", 0, "name"); digest.addCallParam("connector", 1, "className"); Does the order of those statements matter ? My problem is just to know if CallParam actually pushes a String on stack ? If yes, this means that one can't use in tha same time CallMethod and SetNext as in my example. Thank you > -Original Message- > From: Noel Sebastien [SMTP:[EMAIL PROTECTED]] > Sent: jeudi 19 avril 2001 12:28 > To: [EMAIL PROTECTED] > Subject: Digester : "java.lang.InternalError: (Ex02) An error has > occurred " AND "addCallParam" > > Hello, > > It seems that addCallParam push a String on the stack, why ? It is very > annoying for my program. How can I by pass that problem ? > > > I would like to parse the following XML : > > > > > > > > 1/ first : I push my global object on stack (digester.push) > 2/ on config tag : create configClassName object with nested attribute > (new > Object on Digester Stack with addObjectCreate and addSetProperty). > Before automatically pop, I do a addSetNext to store newly object > reference > to global object. > > 3/ on connector end tag I would like to run a method with name and > className > parameters : so I use addCallMethod et 2 addCallParam on connector > pattern, > BUT > addCallParam push a String on stack and my previous AddSetNext is now > launched on that String instead of the global object Thus I receive > that InternalError !!! > > I can't believe it is impossible !! Does somebody have any idea ? > Please, > Thanks, > > Sébastien > > > - > > Un courrier électronique n'engage pas son émetteur. Tout message > susceptible de comporter un engagement doit être confirmé par un écrit > dûment signé. > > An electronic message is not binding on its sender. Any message referring > to a binding engagement must be confirmed in writing and duly signed. > > Ein elektronischer Brief bzw. eine elektronische Nachricht ist für den > Absender nicht verbindlich. Jede Nachricht, welche eine Verpflichtung > beinhaltet, muß schriftlich bestätigt und ordnungsgemäß unterzeichnet > werden. > > - > > > > > - > > An electronic message is not binding on its sender. > Any message referring to a binding engagement must be confirmed in writing > and duly signed. > - - Un courrier électronique n'engage pas son émetteur. Tout message susceptible de comporter un engagement doit être confirmé par un écrit dûment signé. An electronic message is not binding on its sender. Any message referring to a binding engagement must be confirmed in writing and duly signed. Ein elektronischer Brief bzw. eine elektronische Nachricht ist für den Absender nicht verbindlich. Jede Nachricht, welche eine Verpflichtung beinhaltet, muß schriftlich bestätigt und ordnungsgemäß unterzeichnet werden. -
Re: Loggig Mechanism in Struts
> There is current discussion on the TOMCAT-DEV list about switching Tomcat > 4.0 to use Log4J internally. There are some interesting wrinkles to work > out, but this is likely to happen pretty soon. Isn't JDK 1.4 supposed to include a logging API ? This is obviously not an immediate solution, but the current approach taken by Struts should suffice for now. Thereafter, it could be considered as an "always available" solution, just like ServletContext.log() ... -Chris Brown