Re: ActionServlet Action caching problem
My execute/perform methods aren't normally synchronized. The javadocs don't indicate they expect it to be, so, calls to that methods shouldn't get "blocked". However, you could have concurrency problems if you're using static, class, or instance variables. The execute/perform method should limit itself to using local variables or data passed by reference and you won't have this problem. Unless you explicitly declare some class methods synchronized, in which case you're exactly right. If you do that, however, you ought to mean to produce that effect and limit your critical section to a small block of code-- ideally one that doesn't block on anything. ;-) Maybe I'm out to lunch, though. Its been a while since I've coded java threads. -nash On Tuesday, March 11, 2003, at 12:52 PM, Whitmire, Jeffrey wrote: I'll have to look into it, but it seems to me that if the action is doing a non-trivial amount of work (which mine is), then if there are multiple requests, they will get serialized through the single instance of the action. It may be that I need to redesign how my action works, but currently it will submit a job and block until it completes. If there were a pool of actions instead of a single one it seems like it would be more efficient. Jeff. *** This message is intended only for the use of the intended recipient and may contain information that is PRIVILEGED and/or CONFIDENTIAL. If you are not the intended recipient, you are hereby notified that any use, dissemination, disclosure or copying of this communication is strictly prohibited. If you have received this communication in error, please destroy all copies of this message and its attachments and notify us immediately. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT]: Struts, Web Development, J2EE, and what is too much?
I use Jboss. It works quite well with struts. EJBs have made my application EASIER and LESS complex for me, but I don't know any SQL or database technologies at all. If you're comfortable with managing your own database widgets, you may be frustrated with how slow J2EE is on your hardware and you may also be frustrated you can't access some of the more advanced functions easily. Performance is an issue as you pay mad overhead for the RMI stuff in J2EE. Much slower than native JDBC. If you can afford to upgrade your hardware, you may benefit. YMMV, but, I like it. I'm just using struts for presentation. -nash On Monday, March 10, 2003, at 05:41 PM, David Graham wrote: I've never used EJBs but Struts doesn't need to know about them at all. The actions could talk to a service interface that may be implemented by EJBs or just normal Java classes. David From: "Aaron O'Hara" <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: "'Struts-user-list '" <[EMAIL PROTECTED]> Subject: [OT]: Struts, Web Development, J2EE, and what is too much? Date: Mon, 10 Mar 2003 14:34:45 -0800 I know this question has probably been asked before, and that biased publications have had their opinions on it, but I wanted to get some feedback regarding some "real user experience" regarding the use of EJB in a web application used along with Struts. I am creating a web application and I have decided to use struts. The application needs to be high performance, uses a single database (so it doesn't have heterogeneous transactional db requirements). I have designed the application in layers, and it will only have a web interface. It's starting small, but will grow to have many functions. Even though I'm confident that I need not invest in EJB's, I don't want to develop the application to find out I should have used them (hence why I'm creating this post). In what scenarios have people found the use of EJB beneficial? When have they been overkill? Does struts integrate smoothly with EJBs? My fear is that I'll make the application overly complex by implementing EJBs, but I'd like to hear from people with experience building large web-only projects with struts. Thanks, Aaron - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** This message is intended only for the use of the intended recipient and may contain information that is PRIVILEGED and/or CONFIDENTIAL. If you are not the intended recipient, you are hereby notified that any use, dissemination, disclosure or copying of this communication is strictly prohibited. If you have received this communication in error, please destroy all copies of this message and its attachments and notify us immediately. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamic generated controls
I've used code like this in my Action class execute/perform method: String inputs[] = request.getParameterValues(s); for (int x = 0; x < inputs.length; x++) { String oneInput = inputs[x]; dosomething(oneInput); } This seems to work quite well, assuming all the form tags are named the same. I don't know struts well enough, yet, to know whether you can have an ActionForm property be a Collection type, or not. Would be interested in the answer, though. It wouldn't have mattered in my application, though, as I needed to generate an entire form dynamically, so it would have been a wash, either way. -nash On Monday, March 10, 2003, at 04:33 PM, miguel angel rojas aquino wrote: hi, i'm creating a html form that dinamically adds new rows to a html table via javascript, so it goes to the server only when the user ends the data capture, like a jtable control in a swing app, so the problem now is, how can i map all this dynamic controls to the corresponding ActionForm? is there a way to do something like puting all those values in an array in the action form? thanks in advance, greetings. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** This message is intended only for the use of the intended recipient and may contain information that is PRIVILEGED and/or CONFIDENTIAL. If you are not the intended recipient, you are hereby notified that any use, dissemination, disclosure or copying of this communication is strictly prohibited. If you have received this communication in error, please destroy all copies of this message and its attachments and notify us immediately. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionServlet Action caching problem
I've had problems with references to beans on instance variables in an Action object getting stale. I'm on Jboss and in my experience the stale references hork a nice fat RMI exception. Can you turn debug logging on in your execute / perform method and see if that's ever getting called? In my case, it always was. My issue relates to Action objects hanging around after a session bean has been removed or passivated by the EJB container. It would be really nice if someone decided to implement a "timeout" on the Action objects so that if they were older than a certain age, they wouldn't be used. Don't know if we're seeing the same behavior from different angles or not. ciao, -nash On Monday, March 10, 2003, at 04:07 PM, Whitmire, Jeffrey wrote: I've got a weird one. I'm hoping that somebody else has encountered this before and can help. We are in the midst of load testing our app before rolling it out to production. I have one action class (only one) that starts failing well over an hour into the test. It appears that the instance of that action class cached by the ActionServlet becomes invalid. I can see no reason why the change in behaviour, but at some point the RequestProcessor gets an instance to the Action that is no longer valid. It is not null, but it never executes it. The rest of the app works perfectly, but that button (tied to that specific Action) never works again until the tomcat instance is restarted. It just hangs, and the last indication in the log is the RequestProcessor finding and returning an instance of that action class. Has anyone ever had problems with Action instances going stale? or some other config problem that could cause this? Thanks, I'm a bit desparate, Jeff. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** This message is intended only for the use of the intended recipient and may contain information that is PRIVILEGED and/or CONFIDENTIAL. If you are not the intended recipient, you are hereby notified that any use, dissemination, disclosure or copying of this communication is strictly prohibited. If you have received this communication in error, please destroy all copies of this message and its attachments and notify us immediately. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sort a collection in alphabetic order
You could have your PeopleBean implement Comparable, which is pretty easy, and then use TreeSet to create a sorted set using your compareTo method. -nash On Monday, March 10, 2003, at 01:16 PM, Søren Blidorf wrote: Hi. I need to sort my collection "people" in alphabetic order by lastname, firstname. Can anybody help me? I guess I should do it in the Action and not when displayed in jsp page. Collection people = new ArrayList(); while( rs.next() ) { PeopleBean pb = new PeopleBean(); pb.setId(rs.getInt("ID")); pb.setFirstname( rs.getString( "FIRSTNAME" )); pb.setLastname( rs.getString( "LASTNAME" )); } people.add( pb ); Søren Blidorf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** This message is intended only for the use of the intended recipient and may contain information that is PRIVILEGED and/or CONFIDENTIAL. If you are not the intended recipient, you are hereby notified that any use, dissemination, disclosure or copying of this communication is strictly prohibited. If you have received this communication in error, please destroy all copies of this message and its attachments and notify us immediately. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]