OT FRIDAY: Re: JavaServer Faces
At 08:05 PM 10/9/2003 -0400, you wrote: Yes I too have worked on Microsoft Systems where you drag and drop components into a Frame and voila you have a functional web page. 1)First a general feeling if uneasiness about integrating the classic Monolithic Microsoft Component Structure into a working Distributed Environment The idea of integrating so much functionality to be handled by one component gives me a very uneasy feeling. Well, I think a lot of times how much is handled by one component is a matter of the component's design. And when you have a rich set of components to choose from, you can pick more granular ones or more complex ones, depending on your disposition. And, call me crazy, but I have better things to do than write the code necessary to support a full-featured data grid. As the people at companies like Infragistics will tell you, there's a hell of a lot of functionality you can add to a data grid. Personally, I'd rather work on the specific nuances of the system I'm trying to build. For one thing the dependencies between components are not known. In the Microsoft world DB's generally have to be ODBC or not work at all. A more verifiable result is implementing the wrong version of component and you have a disaster.. I'm not quite sure what you're talking about here. Since I did Delphi development, I wasn't aware of any ODBC-specific constraints. My Achilles heel was the Borland Database Engine (BDE). But I won't go into detail about that monstrosity. Using the BDE wasn't a requirement, though, and there were alternative ways to do things. (I think Borland has axed the BDE for good, finally). Also, I wasn't trying to say that Microsoft's way of doing things is better or anything like that. I'm just saying that user interface component-oriented development (RAD, back in the day) yields productivity gains. Microsoft is the most well-known promoter of GUI components, but they're certainly not the only one. 2)Finally I would like to request (Specifically) which IDE's handle JSF today Since JSF isn't even in beta yet, you're not going to find any full-fledged IDEs that support it. My FAQ (http://www.jsfcentral.com/faq/) talks about the companies involved (which includes all of the major Java IDE players), and has some links to quasi-announcements they've made :-). Kito D. Mann Author, JSF in Action www.JSFCentral.com - JSF FAQ, news, and info Thank You, Marty Gainty http://www.laconiadatasystems.com - Original Message - From: Kito D. Mann [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, October 09, 2003 7:55 PM Subject: Re: JavaServer Faces Matt, This looks like a great taglib -- I wish I had found it when I was working on some past projects :-). In the JSF world, this would be a component that you would use the same way -- with a simple taglib. I'm assuming that this type of functionality is what the highly anticipated JSF grid will provide in the next release of JSF (maybe Craig can extrapolate). There's an example of a much less capable, but similar, component in JSF EA4. The main difference between the component and taglib approach is that in the component world, all of this functionality would be implemented by a component/renderer pair. The component itself would be a JavaBean, so it'd have methods, properties, and events, and integrate with tools. You could even have a JavaBeans customizer that would allow you to find and connect to the data source with a wizard interface. You could also develop different renderers, so perhaps one would output HTML and another might work for a WML device. Renderers are separate from the component itself, so all of the basic properties, like the data source, wouldn't have to be changed for a new device -- only the renderer. Anyway, we're probably getting a little too off-topic, so drop me a line personally if you want to chat more :-). Kito D. Mann [EMAIL PROTECTED] Author, JSF in Action www.JSFCentral.com - JSF FAQ, news, and info At 06:37 PM 10/9/2003 -0400, you wrote: Here is an example of something I do a lot of w/Struts: http://displaytag.sf.net (that Matt contributed to) You can click on examples link (uper right) to see nested, pagination, etc. Using your skill and experience you listed, can you show something similar? .V Kito D. Mann wrote: At 11:20 AM 10/9/2003 -0500, you wrote: I watched a presentation on JSF last night. Here's my high-level impressions: 1. It's a replacement for Struts (no matter what folks say). It may be in the long-term, but it won't be in version 1.0. I think the combination of the two is pretty powerful. 2. It's basically Swing for the Web. True. 3. It's more difficult than Struts. I think it might be more difficult for people who haven't worked with desktop-oriented GUI frameworks like Swing, Delphi's VCL, or Visual Basic OCXs (and likewise .NET). Once you get used to a more
Problem validating form manually in DispatchAction
Hi there, am having a problem validating a form manually using the DynaValidatorForm.validate() function. For some reason, when validation is carried out this way it only seems to find errors in one of the form fields - however, if I set the validate=true property in the struts-module-config.xml file, validation does seem to be carried out properly, which suggests to me that I did not make a mistake in the validation configuration. Since I want to use DispatchAction however, I can't use validate=true, as I need to validate the form selectively for one of the methods only. I have tried using ValidatorLookupdispatchForm, but can't use it as Struts 1.1 (which I am using) seems to have a bug with the set-property tag in the module-config.xml file. Also tried latest version of Struts (1.1, was using 1.1rc3) and of the validator (1.0, 1.02, latest nightly build). My code is as follows - pretty straightforward: Action DynaValidatorForm thisForm = (DynaValidatorForm)form; ActionErrors errors=thisForm.validate(mapping,request); Integer var1= (Integer)thisForm.get(var1); (... get more form vars...) //if errors, back to form if (!errors.isEmpty()) { saveErrors(request, errors); return mapping.getInputForward(); } /Action struts-module-config.xml action input=/editUserDetails.vm name=details_form path=/details scope=request parameter=method type=com.inc.modules.users.DetailsAction validate=false !-- not working in struts 1.1 set-property property=validateMethod(doEdit) value=true/ set-property property=validateMethod(viewEdit) value=false/ set-property property=validateMethod(viewDetails) value=false/ -- forward name=view path=/viewUserDetails.vm redirect=false/ /action /struts-module-config.xml validation-module.xml form name=details_form field property=var1 depends=required,integer msg name=required key=errors.required/ arg0 name=required key=forms.var1/ msg name=integer key=errors.integer/ arg0 name=integer key=forms.var1/ /field /form /validation-module.xml I have spent almost 2 days trying to figure ways of getting around this - anyone have any ideas? Thanks, Elie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
reloading of properties/resources file
how can i force the reloading of my properties/resource file in struts? thanks.
RE: ejb's and tomcat
Yeah, but the only reason I posted that msg was for baiting purposes...and apparently I caught a lot of fish... ;-P Mark -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 9:37 AM To: 'Struts Users Mailing List' Subject: RE: ejb's and tomcat I agree, but I was responding to your jboss is crap statement, which also has little to do with entity beans. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 11:41 To: Struts Users Mailing List Subject: RE: ejb's and tomcat That's an improvement, but really has little to do with EJB entity beans. -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 8:33 AM To: 'Struts Users Mailing List' Subject: RE: ejb's and tomcat Can't really agree with that. Besides, jboss have just employed the creator of hibernate and its CMP layer is going to be powered by hibernate in the near future anyway. So if you're a fan of hibernate, you'll get the same thing under the hood with jboss and CMP ejbs. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 11:08 To: Struts Users Mailing List Subject: RE: ejb's and tomcat JBoss is crap, anyway. -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 7:44 AM This isn't the case for jboss at least. You gain major performance increases. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 10:35 Yes, the advantage of using local interfaces in EJBs is avoiding the creation of stubs and skeletons, use of RMI and serialization. But what many people don't realize is that all the major containers have been doing this since 1.1 anyway, abeit in proprietary ways. You really gain no performance advantage by explicitly declaring an EJB interface local - you merely adhere to the specification. Mark -Original Message- From: Kunal H. Parikh [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2003 8:20 PM The CMP2.x spec allows declaring EJBs as local objects. The advantage of the local EJB objects is that they don't get serialized/deserialized(I think) and pass-by-reference and not by-value. Effectively, If you use a LocalEJB, you have the flexibitly of making the REMOTE with very few changes to code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ejb's and tomcat
Strangely enough I find most of your posts are decidedly fishy. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: Friday, 10 October 2003 18:51 To: Struts Users Mailing List Subject: RE: ejb's and tomcat Yeah, but the only reason I posted that msg was for baiting purposes...and apparently I caught a lot of fish... ;-P Mark -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 9:37 AM To: 'Struts Users Mailing List' Subject: RE: ejb's and tomcat I agree, but I was responding to your jboss is crap statement, which also has little to do with entity beans. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 11:41 To: Struts Users Mailing List Subject: RE: ejb's and tomcat That's an improvement, but really has little to do with EJB entity beans. -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 8:33 AM To: 'Struts Users Mailing List' Subject: RE: ejb's and tomcat Can't really agree with that. Besides, jboss have just employed the creator of hibernate and its CMP layer is going to be powered by hibernate in the near future anyway. So if you're a fan of hibernate, you'll get the same thing under the hood with jboss and CMP ejbs. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 11:08 To: Struts Users Mailing List Subject: RE: ejb's and tomcat JBoss is crap, anyway. -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 7:44 AM This isn't the case for jboss at least. You gain major performance increases. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 10:35 Yes, the advantage of using local interfaces in EJBs is avoiding the creation of stubs and skeletons, use of RMI and serialization. But what many people don't realize is that all the major containers have been doing this since 1.1 anyway, abeit in proprietary ways. You really gain no performance advantage by explicitly declaring an EJB interface local - you merely adhere to the specification. Mark -Original Message- From: Kunal H. Parikh [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2003 8:20 PM The CMP2.x spec allows declaring EJBs as local objects. The advantage of the local EJB objects is that they don't get serialized/deserialized(I think) and pass-by-reference and not by-value. Effectively, If you use a LocalEJB, you have the flexibitly of making the REMOTE with very few changes to code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ejb's and tomcat
I agree they scale well -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 6:56 AM Strangely enough I find most of your posts are decidedly fishy. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: Friday, 10 October 2003 18:51 Yeah, but the only reason I posted that msg was for baiting purposes...and apparently I caught a lot of fish... ;-P Mark -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 9:37 AM I agree, but I was responding to your jboss is crap statement, which also has little to do with entity beans. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 11:41 That's an improvement, but really has little to do with EJB entity beans. -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 8:33 AM Can't really agree with that. Besides, jboss have just employed the creator of hibernate and its CMP layer is going to be powered by hibernate in the near future anyway. So if you're a fan of hibernate, you'll get the same thing under the hood with jboss and CMP ejbs. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 11:08 JBoss is crap, anyway. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Is Java Overkill?
http://www.sys-con.com/Java/article.cfm?id=2257 Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ejb's and tomcat
Well congrats on a) wasting other people's time b) giving bad advice perhaps you should consider fishing elsewhere. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 10 October 2003 10:51 To: Struts Users Mailing List Subject: RE: ejb's and tomcat Yeah, but the only reason I posted that msg was for baiting purposes...and apparently I caught a lot of fish... ;-P Mark -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 9:37 AM To: 'Struts Users Mailing List' Subject: RE: ejb's and tomcat I agree, but I was responding to your jboss is crap statement, which also has little to do with entity beans. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 11:41 To: Struts Users Mailing List Subject: RE: ejb's and tomcat That's an improvement, but really has little to do with EJB entity beans. -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 8:33 AM To: 'Struts Users Mailing List' Subject: RE: ejb's and tomcat Can't really agree with that. Besides, jboss have just employed the creator of hibernate and its CMP layer is going to be powered by hibernate in the near future anyway. So if you're a fan of hibernate, you'll get the same thing under the hood with jboss and CMP ejbs. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 11:08 To: Struts Users Mailing List Subject: RE: ejb's and tomcat JBoss is crap, anyway. -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 7:44 AM This isn't the case for jboss at least. You gain major performance increases. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 10:35 Yes, the advantage of using local interfaces in EJBs is avoiding the creation of stubs and skeletons, use of RMI and serialization. But what many people don't realize is that all the major containers have been doing this since 1.1 anyway, abeit in proprietary ways. You really gain no performance advantage by explicitly declaring an EJB interface local - you merely adhere to the specification. Mark -Original Message- From: Kunal H. Parikh [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2003 8:20 PM The CMP2.x spec allows declaring EJBs as local objects. The advantage of the local EJB objects is that they don't get serialized/deserialized(I think) and pass-by-reference and not by-value. Effectively, If you use a LocalEJB, you have the flexibitly of making the REMOTE with very few changes to code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] JSTL Primer
http://today.java.net/pub/a/today/2003/10/07/jstl1.html Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
redirect problem
Hi If my httpsession is invalid, I want to send the user to the logon page. I tried it in different ways, but get an error everytime I tried it like this : (sessionIsValid is a attribute in the session. If this attribute is null, it means that my session does no longer exist). logic:notPresent name=sessionIsValid scope=session logic:forward name=/sessionTimedOut/ /logic:notPresent This is the error I get : javax.servlet.jsp.JspException: Exception redirecting for name /sessionTimedOut: java.lang.IllegalStateException [10/10/03 13:08:25:033 CEST] 5355efea SystemErr R at org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:164) [10/10/03 13:08:25:033 CEST] 5355efea SystemErr R at org.apache.jsp._specialCode1._jspService(_specialCode1.java:164) [10/10/03 13:08:25:033 CEST] 5355efea SystemErr R at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89) [10/10/03 13:08:25:033 CEST] 5355efea SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) [10/10/03 13:08:25:043 CEST] 5355efea SystemErr R at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344) [10/10/03 13:08:25:043 CEST] 5355efea SystemErr R at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:598) [10/10/03 13:08:25:043 CEST] 5355efea SystemErr R Thanks for any help. Koen Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail! http://login.mail.lycos.com/r/referral?aid=27005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ejb's and tomcat
Apparently more than 20 people believed it was important enough to spark a discussion of the issue, so if it was a waste of your time, perhaps you are just too important for this list? As far as bad advice goes, most of the people I know in the *real* world agree with my assessment: JBoss is not worth the trouble. In short, it's crap. Oh yeah...and thanks for the waste of bandwidth with your useless msg; next time, practice what you supposedly believe and email your criticism privately. Marko Sharko -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 8:19 AM To: 'Struts Users Mailing List' Subject: RE: ejb's and tomcat Well congrats on a) wasting other people's time b) giving bad advice perhaps you should consider fishing elsewhere. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 10 October 2003 10:51 To: Struts Users Mailing List Subject: RE: ejb's and tomcat Yeah, but the only reason I posted that msg was for baiting purposes...and apparently I caught a lot of fish... ;-P Mark -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 9:37 AM To: 'Struts Users Mailing List' Subject: RE: ejb's and tomcat I agree, but I was responding to your jboss is crap statement, which also has little to do with entity beans. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 11:41 To: Struts Users Mailing List Subject: RE: ejb's and tomcat That's an improvement, but really has little to do with EJB entity beans. -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 8:33 AM To: 'Struts Users Mailing List' Subject: RE: ejb's and tomcat Can't really agree with that. Besides, jboss have just employed the creator of hibernate and its CMP layer is going to be powered by hibernate in the near future anyway. So if you're a fan of hibernate, you'll get the same thing under the hood with jboss and CMP ejbs. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 11:08 To: Struts Users Mailing List Subject: RE: ejb's and tomcat JBoss is crap, anyway. -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 7:44 AM This isn't the case for jboss at least. You gain major performance increases. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 10:35 Yes, the advantage of using local interfaces in EJBs is avoiding the creation of stubs and skeletons, use of RMI and serialization. But what many people don't realize is that all the major containers have been doing this since 1.1 anyway, abeit in proprietary ways. You really gain no performance advantage by explicitly declaring an EJB interface local - you merely adhere to the specification. Mark -Original Message- From: Kunal H. Parikh [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2003 8:20 PM The CMP2.x spec allows declaring EJBs as local objects. The advantage of the local EJB objects is that they don't get serialized/deserialized(I think) and pass-by-reference and not by-value. Effectively, If you use a LocalEJB, you have the flexibitly of making the REMOTE with very few changes to code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to read contents of MANIFEST.MF
1. the META-INF directory should be under the webapp root, not a WEB-INF subdirectory; 2. read the file into an action class with java.io.FileReader, set the object in some scope, and display it in a JSP with a bean:write/. Mark -Original Message- From: Martin Gross [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 7:13 AM To: Struts Users Mailing List Subject: How to read contents of MANIFEST.MF I would like to read the content of /WEB-INF/META-INF/MANIFEST.MF file by a struts based application. Does anybody have an example how to do it? The only references I found are only for jar files. TIA, Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts and Tomcat JDBC Realms
Hi all ! I was woundering about using Struts in Tomcat with JDBC Realms. I found lots of topics about Strunts and Realms but using policy files and I did not find any question or topic involving struts and JDBC Reals. Does struts support the use of JDBC Realms in Tomcat ? I don't intent to use it to proctect my Actions, but to protect my jsp pages under some specific app directories. I tried to implement this running Tomcat in Security Mode but I have some SecurityExceptions in some actions. Is it common ? Could I solve it setting priviledges to struts.jar in my catalina.policy ? And so, does anybody implemented Struts + JDBC Realms + Tomcat ? Thanks in advance, Michel. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to read contents of MANIFEST.MF
Will this do? import java.util.jar.Manifest; ... ServletContext ctx = ...; InputStream in = ctx.getResourceAsStream(/META-INF/MANIFEST.MF); if (in != null) { Manifest mfst = new Manifest(in); ... in.close(); } Quoting Martin Gross [EMAIL PROTECTED]: I would like to read the content of /WEB-INF/META-INF/MANIFEST.MF file by a struts based application. Does anybody have an example how to do it? The only references I found are only for jar files. TIA, Martin -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Correction: DynaValidatorForm.validate() does not seemt o validate Integers when called from DispatchAction [Re: Problem validating form manually in DispatchAction]
In reference to the problem below, it actually seems that the DynaValidatorForm.validate() method does validate Strings, but not Integers any clues appreciated Elie Hi there, am having a problem validating a form manually using the DynaValidatorForm.validate() function. For some reason, when validation is carried out this way it only seems to find errors in one of the form fields - however, if I set the validate=true property in the struts-module-config.xml file, validation does seem to be carried out properly, which suggests to me that I did not make a mistake in the validation configuration. Since I want to use DispatchAction however, I can't use validate=true, as I need to validate the form selectively for one of the methods only. I have tried using ValidatorLookupdispatchForm, but can't use it as Struts 1.1 (which I am using) seems to have a bug with the set-property tag in the module-config.xml file. Also tried latest version of Struts (1.1, was using 1.1rc3) and of the validator (1.0, 1.02, latest nightly build). My code is as follows - pretty straightforward: Action DynaValidatorForm thisForm = (DynaValidatorForm)form; ActionErrors errors=thisForm.validate(mapping,request); Integer var1= (Integer)thisForm.get(var1); (... get more form vars...) //if errors, back to form if (!errors.isEmpty()) { saveErrors(request, errors); return mapping.getInputForward(); } /Action struts-module-config.xml action input=/editUserDetails.vm name=details_form path=/details scope=request parameter=method type=com.inc.modules.users.DetailsAction validate=false !-- not working in struts 1.1 set-property property=validateMethod(doEdit) value=true/ set-property property=validateMethod(viewEdit) value=false/ set-property property=validateMethod(viewDetails) value=false/ -- forward name=view path=/viewUserDetails.vm redirect=false/ /action /struts-module-config.xml validation-module.xml form name=details_form field property=var1 depends=required,integer msg name=required key=errors.required/ arg0 name=required key=forms.var1/ msg name=integer key=errors.integer/ arg0 name=integer key=forms.var1/ /field /form /validation-module.xml I have spent almost 2 days trying to figure ways of getting around this - anyone have any ideas? Thanks, Elie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to read contents of MANIFEST.MF
Where did you get this from? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 7:50 AM import java.util.jar.Manifest; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to read contents of MANIFEST.MF
It's not mine, I'm just holding onto it for a friend. Quoting Mark Galbreath [EMAIL PROTECTED]: Where did you get this from? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 7:50 AM import java.util.jar.Manifest; -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: redirect problem
You can extend RequestProcessor using a intercepting filter pattern for preprocessing (http://java.sun.com/blueprints/patterns/InterceptingFilter.html), so you don't have to check the session in every jsp. public class MyRequestProcessor extends RequestProcessor { PreProcessingFilter firstPreProcessingFilter; public MyRequestProcessor() { firstPreProcessingFilter = new SessionPreProcessingFilter( new AuthenticationPreProcessingFilter(null)); } protected ActionForward processActionPerform( HttpServletRequest request, HttpServletResponse response, Action action, ActionForm form, ActionMapping mapping) throws IOException, ServletException { ActionForward actionForward = firstPreProcessingFilter.process( request, response, action, form, mapping); if (actionForward == null) { return super.processActionPerform(request, response, action, form, mapping); } else { return actionForward; } } } /** * A base clase for all preprocessing filters. Usually, concrete filters only * need to provide an implementation of codedoProcess/code. */ public abstract class PreProcessingFilter { private PreProcessingFilter nextFilter; public PreProcessingFilter(PreProcessingFilter nextFilter) { this.nextFilter = nextFilter; } /** * Calls upon codedoProcess/code, and if necessary, continues to call * codeprocess/code on the next filter. */ public ActionForward process(HttpServletRequest request, HttpServletResponse response, Action action, ActionForm form, ActionMapping mapping) throws IOException, ServletException { ActionForward actionForward = null; /* Process this filter. */ actionForward = doProcess(request, response, action, form, mapping); /* Process next filter in the chain. */ if ((actionForward == null) (nextFilter != null)) { return nextFilter.process(request, response, action, form, mapping); } else { return actionForward; } } /** * Does the processing of this filter. * * @return codenull/code if the next filter must be processed; an * codeActionForward/code otherwise */ protected abstract ActionForward doProcess(HttpServletRequest request, HttpServletResponse response, Action action, ActionForm form, ActionMapping mapping) throws IOException, ServletException, InternalErrorException; } -Mensaje original- De: koen boutsen [mailto:[EMAIL PROTECTED] Enviado el: viernes, 10 de octubre de 2003 13:32 Para: Struts Users Mailing List Asunto: redirect problem Hi If my httpsession is invalid, I want to send the user to the logon page. I tried it in different ways, but get an error everytime I tried it like this : (sessionIsValid is a attribute in the session. If this attribute is null, it means that my session does no longer exist). logic:notPresent name=sessionIsValid scope=session logic:forward name=/sessionTimedOut/ /logic:notPresent This is the error I get : javax.servlet.jsp.JspException: Exception redirecting for name /sessionTimedOut: java.lang.IllegalStateException [10/10/03 13:08:25:033 CEST] 5355efea SystemErr R at org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag. java:164) [10/10/03 13:08:25:033 CEST] 5355efea SystemErr R at org.apache.jsp._specialCode1._jspService(_specialCode1.java:164) [10/10/03 13:08:25:033 CEST] 5355efea SystemErr R at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJs pBase.java:89) [10/10/03 13:08:25:033 CEST] 5355efea SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) [10/10/03 13:08:25:043 CEST] 5355efea SystemErr R at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapp er.service(JspServlet.java:344) [10/10/03 13:08:25:043 CEST] 5355efea SystemErr R at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile( JspServlet.java:598) [10/10/03 13:08:25:043 CEST] 5355efea SystemErr R Thanks for any help. Koen Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail! http://login.mail.lycos.com/r/referral?aid=27005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: contains(String, String) in DynaActionForm
key is a reference to a value in the Application.resources file -Original Message- From: Marc Dugger [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 5:14 PM To: [EMAIL PROTECTED] Subject: contains(String, String) in DynaActionForm Can someone explain the parameters of this method? The javadocs call them 'name' and 'key'. I gather that 'name' refers to the 'name' attribute of the form-property in struts-config. If so, what does 'key' refer to? Thanks. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.522 / Virus Database: 320 - Release Date: 9/29/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re[2]: How to read contents of MANIFEST.MF
That is what I was looking for. Thanks a lot. Will this do? import java.util.jar.Manifest; ... ServletContext ctx = ...; InputStream in = ctx.getResourceAsStream(/META-INF/MANIFEST.MF); if (in != null) { Manifest mfst = new Manifest(in); ... in.close(); } Quoting Martin Gross [EMAIL PROTECTED]: I would like to read the content of /WEB-INF/META-INF/MANIFEST.MF file by a struts based application. Does anybody have an example how to do it? The only references I found are only for jar files. TIA, Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: redirect problem
So,I have to write my session control in the doProcess() method ? How do I have to configure my application so that every request goes through this filter ? -- - Original Message - DATE: Fri, 10 Oct 2003 13:58:40 From: Carlos Sanchez [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED],[EMAIL PROTECTED] Cc: You can extend RequestProcessor using a intercepting filter pattern for preprocessing (http://java.sun.com/blueprints/patterns/InterceptingFilter.html), so you don't have to check the session in every jsp. public class MyRequestProcessor extends RequestProcessor { PreProcessingFilter firstPreProcessingFilter; public MyRequestProcessor() { firstPreProcessingFilter = new SessionPreProcessingFilter( new AuthenticationPreProcessingFilter(null)); } protected ActionForward processActionPerform( HttpServletRequest request, HttpServletResponse response, Action action, ActionForm form, ActionMapping mapping) throws IOException, ServletException { ActionForward actionForward = firstPreProcessingFilter.process( request, response, action, form, mapping); if (actionForward == null) { return super.processActionPerform(request, response, action, form, mapping); } else { return actionForward; } } } /** * A base clase for all preprocessing filters. Usually, concrete filters only * need to provide an implementation of codedoProcess/code. */ public abstract class PreProcessingFilter { private PreProcessingFilter nextFilter; public PreProcessingFilter(PreProcessingFilter nextFilter) { this.nextFilter = nextFilter; } /** * Calls upon codedoProcess/code, and if necessary, continues to call * codeprocess/code on the next filter. */ public ActionForward process(HttpServletRequest request, HttpServletResponse response, Action action, ActionForm form, ActionMapping mapping) throws IOException, ServletException { ActionForward actionForward = null; /* Process this filter. */ actionForward = doProcess(request, response, action, form, mapping); /* Process next filter in the chain. */ if ((actionForward == null) (nextFilter != null)) { return nextFilter.process(request, response, action, form, mapping); } else { return actionForward; } } /** * Does the processing of this filter. * * @return codenull/code if the next filter must be processed; an * codeActionForward/code otherwise */ protected abstract ActionForward doProcess(HttpServletRequest request, HttpServletResponse response, Action action, ActionForm form, ActionMapping mapping) throws IOException, ServletException, InternalErrorException; } -Mensaje original- De: koen boutsen [mailto:[EMAIL PROTECTED] Enviado el: viernes, 10 de octubre de 2003 13:32 Para: Struts Users Mailing List Asunto: redirect problem Hi If my httpsession is invalid, I want to send the user to the logon page. I tried it in different ways, but get an error everytime I tried it like this : (sessionIsValid is a attribute in the session. If this attribute is null, it means that my session does no longer exist). logic:notPresent name=sessionIsValid scope=session logic:forward name=/sessionTimedOut/ /logic:notPresent This is the error I get : javax.servlet.jsp.JspException: Exception redirecting for name /sessionTimedOut: java.lang.IllegalStateException [10/10/03 13:08:25:033 CEST] 5355efea SystemErr R at org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag. java:164) [10/10/03 13:08:25:033 CEST] 5355efea SystemErr R at org.apache.jsp._specialCode1._jspService(_specialCode1.java:164) [10/10/03 13:08:25:033 CEST] 5355efea SystemErr R at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJs pBase.java:89) [10/10/03 13:08:25:033 CEST] 5355efea SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) [10/10/03 13:08:25:043 CEST] 5355efea SystemErr R at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapp er.service(JspServlet.java:344) [10/10/03 13:08:25:043 CEST] 5355efea SystemErr R at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile( JspServlet.java:598) [10/10/03 13:08:25:043 CEST] 5355efea SystemErr R Thanks for any help. Koen
problem with forwarding to input from the method validate
Hi, I'm working with Struts 1.1 and tiles. It seems like the validate() can't forward to my tiles page when an ActionErrors occurs. Here is my struts-config.xml file : action path=/EditDossCEAction type=com.atosorigin.agrippa.web.communs.doss.EditDossCEAction scope=request name=EditDossCEForm attribute=EditDossCEForm input=page.communs.editDossCECarte validate=true forward name=edit path=page.communs.editDossCE / forward name=editCarte path=page.communs.editDossCECarte / /action When my method validate on EditDossCEForm fails it returns a non null ActionErrors and this is supposed to forward to the input page. The RequestProcessor seems to find page.communs.editDossCECarte as the input, however it fails in finding the corresponding tiles definition ( mapping.findForward(input) is null) and therefore forward me to the correct page. I solved this problem by adding this forward : forward name=page.communs.editDossCECarte path=page.communs.editDossCECarte / Was anyone aware of this problem ? Any other way to solve this ? Raphaël - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ejb's and tomcat
As far as bad advice goes, most of the people I know in the *real* world agree with my assessment: JBoss is not worth the trouble. In short, it's crap. You must be joking, right? I certainly live in the real world. And in my 'real' world we realy use JBoss. We use it for development and even in production. I definitly think it's a good product, and for sure no 'crap'. Especially if you see what you get for *free*. Compare this to the prices asked for BEA's or IBM's application server. Regards, Harm de Laat Informatiefabriek The Netherlands Mark Galbreath [EMAIL PROTECTED] 10/10/2003 01:35 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To Struts Users Mailing List [EMAIL PROTECTED] cc Subject RE: ejb's and tomcat Apparently more than 20 people believed it was important enough to spark a discussion of the issue, so if it was a waste of your time, perhaps you are just too important for this list? As far as bad advice goes, most of the people I know in the *real* world agree with my assessment: JBoss is not worth the trouble. In short, it's crap. Oh yeah...and thanks for the waste of bandwidth with your useless msg; next time, practice what you supposedly believe and email your criticism privately. Marko Sharko -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 8:19 AM To: 'Struts Users Mailing List' Subject: RE: ejb's and tomcat Well congrats on a) wasting other people's time b) giving bad advice perhaps you should consider fishing elsewhere. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 10 October 2003 10:51 To: Struts Users Mailing List Subject: RE: ejb's and tomcat Yeah, but the only reason I posted that msg was for baiting purposes...and apparently I caught a lot of fish... ;-P Mark -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 9:37 AM To: 'Struts Users Mailing List' Subject: RE: ejb's and tomcat I agree, but I was responding to your jboss is crap statement, which also has little to do with entity beans. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 11:41 To: Struts Users Mailing List Subject: RE: ejb's and tomcat That's an improvement, but really has little to do with EJB entity beans. -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 8:33 AM To: 'Struts Users Mailing List' Subject: RE: ejb's and tomcat Can't really agree with that. Besides, jboss have just employed the creator of hibernate and its CMP layer is going to be powered by hibernate in the near future anyway. So if you're a fan of hibernate, you'll get the same thing under the hood with jboss and CMP ejbs. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 11:08 To: Struts Users Mailing List Subject: RE: ejb's and tomcat JBoss is crap, anyway. -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 7:44 AM This isn't the case for jboss at least. You gain major performance increases. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: 09 October 2003 10:35 Yes, the advantage of using local interfaces in EJBs is avoiding the creation of stubs and skeletons, use of RMI and serialization. But what many people don't realize is that all the major containers have been doing this since 1.1 anyway, abeit in proprietary ways. You really gain no performance advantage by explicitly declaring an EJB interface local - you merely adhere to the specification. Mark -Original Message- From: Kunal H. Parikh [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2003 8:20 PM The CMP2.x spec allows declaring EJBs as local objects. The advantage of the local EJB objects is that they don't get serialized/deserialized(I think) and pass-by-reference and not by-value. Effectively, If you use a LocalEJB, you have the flexibitly of making the REMOTE with very few changes to code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: redirect problem
In struts-config.xml controller processorClass=blah.blah.MyRequestProcessor/ My authentication filter used an atribute authenticationRequired in the action mapping (note that this is not an elegant solution because it doesn't follows the DTD specification) action-mappings type=es.udc.is203.j2ee.eshop.http.controller.frontcontroller.EShopActionMap ping action path=/user/UpdateUserProfileDetails type=es.udc.is203.j2ee.eshop.http.controller.actions.user.UpdateUserProfile DetailsAction name=userProfileForm scope=request input=/user/EditUserProfile.do validate=true authenticationRequired=true/ /** * A filter to check if the action to be executed requires that the user had * been authenticated. If the user has not been authenticated and the action * requires it, codedoProcess/code returns the codeActionForward/code * returned by codemapping.findForward(AuthenticationPage)/code. * br * The uri of the action to be executed is stored in the request as * codeuri/code and the parameters as codeparameters/code so them can * be retrieved later to continue the operation. * * pTitle: IS e-Shop/p * pDescription: /p * pCopyright: Copyright (c) 2003/p * pCompany: /p * @author a href=mailto:[EMAIL PROTECTED]Carlos Sanchez Gonzalez/a - * a href=mailto:[EMAIL PROTECTED]Ines Silva Liste/a - * a href=mailto:[EMAIL PROTECTED]Jose Mora Garcia/a * @version 4.1 */ public class AuthenticationPreProcessingFilter extends PreProcessingFilter { public AuthenticationPreProcessingFilter(PreProcessingFilter nextFilter) { super(nextFilter); } protected ActionForward doProcess(HttpServletRequest request, HttpServletResponse response, Action action, ActionForm form, ActionMapping mapping) throws IOException, ServletException, InternalErrorException { EShopActionMapping eShopActionMapping = (EShopActionMapping) mapping; if (eShopActionMapping.getAuthenticationRequired()) { if (SessionManager.isUserAuthenticated(request)) { return null; } else { String uri = request.getRequestURI(); uri = uri.substring(request.getContextPath().length()); request.setAttribute(uri, uri); request.setAttribute(parameters, request.getParameterMap().entrySet()); return mapping.findForward(AuthenticationPage); } } else { return null; } } } -Mensaje original- De: koen boutsen [mailto:[EMAIL PROTECTED] Enviado el: viernes, 10 de octubre de 2003 14:52 Para: Struts Users Mailing List Asunto: RE: redirect problem So,I have to write my session control in the doProcess() method ? How do I have to configure my application so that every request goes through this filter ? -- - Original Message - DATE: Fri, 10 Oct 2003 13:58:40 From: Carlos Sanchez [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED],[EMAIL PROTECTED] Cc: You can extend RequestProcessor using a intercepting filter pattern for preprocessing (http://java.sun.com/blueprints/patterns/InterceptingFilter.h tml), so you don't have to check the session in every jsp. public class MyRequestProcessor extends RequestProcessor { PreProcessingFilter firstPreProcessingFilter; public MyRequestProcessor() { firstPreProcessingFilter = new SessionPreProcessingFilter( new AuthenticationPreProcessingFilter(null)); } protected ActionForward processActionPerform( HttpServletRequest request, HttpServletResponse response, Action action, ActionForm form, ActionMapping mapping) throws IOException, ServletException { ActionForward actionForward = firstPreProcessingFilter.process( request, response, action, form, mapping); if (actionForward == null) { return super.processActionPerform(request, response, action, form, mapping); } else { return actionForward; } } } /** * A base clase for all preprocessing filters. Usually, concrete filters only * need to provide an implementation of codedoProcess/code. */ public abstract class PreProcessingFilter { private PreProcessingFilter nextFilter; public PreProcessingFilter(PreProcessingFilter nextFilter) { this.nextFilter = nextFilter; } /** * Calls upon codedoProcess/code, and if necessary, continues to call * codeprocess/code on the next filter. */ public ActionForward process(HttpServletRequest request,
RE: defaullt selection of radio button
The bean parameter which are using to store the value for this radio button after form submission; just initialize that to the value which you want to be checked by default when page renders. e.g. in form-bean, you have: int param = 1; // initializing with the no. that you want to be checked in jsp; it will be: html:radio property=param 1 /html:radio Regards, MMS -- From: Sunil Sharma (C) [SMTP:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 6:26 PM To: Struts Users Mailing List Subject: defaullt selection of radio button Group, I had some radio buttons. There is requirement to auto select one of the button by default. Can any body give me some pointers how can I do that Thanks in advance Sunil
Please help with this error ???en_US.errors.required???
I have a login.jsp which I use DynaValidatorForm. Both the username and password are required fields. When I submited the page without entering these data, I got ???en_US.errors.required??? and ???en_US.errors.required???. It looks like the validation was peformed because I got two error.required messages but I don't understand why it was not able to print the accurate message. please help. Thanks in adavance. In xxxResources.properties: errors.required={0} is required. errors.minlength={0} cannot be less than {1} characters. errors.maxlength={0} cannot be greater than {2} characters. ... In struts-config.xml: form-beans !-- Login form bean -- form-bean name=loginForm type=org.apache.struts.validator.DynaValidatorForm form-property name=username type=java.lang.String/ form-property name=password type=java.lang.String/ /form-bean /form-beans message-resources parameter=xxxResources/ I packaged the xxxResource.properties in my xxx.war: WEB-INF/classes/xxxResources.properties In Validation.xml: form-validation formset form name=loginForm field property=username depends=required,minlength,maxlength arg0 key=prompt.username/ arg1 key=${var:minlength} name=minlength resource=false/ arg2 key=${var:maxlength} name=maxlength resource=false/ var var-namemaxlength/var-name var-value16/var-value /var var var-nameminlength/var-name var-value3/var-value /var /field .. /form - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please help with this error ???en_US.errors.required???
Hi Vivien, Take a look at your web.xml. Maybe you copied it from Struts dist and message-resources was already configured there. As settings in web.xml will override settings in struts-config.xml, classloader can't find resource to be loaded and then you get that messages. Hope i helped you. Kind regards, Daniel. --- Chen, Vivien [EMAIL PROTECTED] wrote: I have a login.jsp which I use DynaValidatorForm. Both the username and password are required fields. When I submited the page without entering these data, I got ???en_US.errors.required??? and ???en_US.errors.required???. It looks like the validation was peformed because I got two error.required messages but I don't understand why it was not able to print the accurate message. please help. Thanks in adavance. In xxxResources.properties: errors.required={0} is required. errors.minlength={0} cannot be less than {1} characters. errors.maxlength={0} cannot be greater than {2} characters. ... In struts-config.xml: form-beans !-- Login form bean -- form-bean name=loginForm type=org.apache.struts.validator.DynaValidatorForm form-property name=username type=java.lang.String/ form-property name=password type=java.lang.String/ /form-bean /form-beans message-resources parameter=xxxResources/ I packaged the xxxResource.properties in my xxx.war: WEB-INF/classes/xxxResources.properties In Validation.xml: form-validation formset form name=loginForm field property=username depends=required,minlength,maxlength arg0 key=prompt.username/ arg1 key=${var:minlength} name=minlength resource=false/ arg2 key=${var:maxlength} name=maxlength resource=false/ var var-namemaxlength/var-name var-value16/var-value /var var var-nameminlength/var-name var-value3/var-value /var /field .. /form - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tools for Testing
Martin Gainty [EMAIL PROTECTED] wrote: Modify Artur's TestCase generator http://wttools.sourceforge.net/unittestsgen/package.html to handle StrutsTestCase and this could be automated... beautiful, Funny you should bring this up. I just spent Wednesday working with StrutsTestCase and UnitTestsGen and talking with Artur Hefczyc. UnitTestsGen isn't being maintained anymore, but he's more than willing to let someone else become a project member and take it over. However, the templates are currently written in Java C code statements. I spent Thursday looking at JUnitDoclet which offers all of the same functionality plus a little bit more and is actively maintained. I'd recommend you take a look at this instead. It's a bit more work to get it set up and going than UnitTestsGen, but most of that can be fixed by helping create better documentation (which is what I plan to submit to JunitDoclet after posting this message). -Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help with Tiles matching a checkbox
I am trying to have a Tile replace an html checkbox with an image. But I can't seem to get this to work. tiles:useAttribute id=beanName name=property classname=java.lang.String ignore=true / tiles:importAttribute name=bean / bean:define id=checkbox name=bean property='%= beanName %' type=java.lang.String value= / logic:present name=bean logic:match name=bean property='%= checkbox %' value=on %= checkbox %:::logicmatchhtml:img bundle=IMAGE_RESOURCES_KEY height=15 width=15 srcKey=default.checked / /logic:match logic:notMatch name=bean property='%= checkbox %' value=on %= checkbox %logic:notMatchhtml:img bundle=IMAGE_RESOURCES_KEY height=15 width=15 srcKey=default.unchecked / /logic:notMatch /logic:present logic:present name=bean logic:match name=bean property='%= checkbox %' value=on %= checkbox %:::logicmatchhtml:img bundle=IMAGE_RESOURCES_KEY height=15 width=15 srcKey=default.checked / /logic:match logic:notMatch name=bean property='%= checkbox %' value=on %= checkbox %logic:notMatchhtml:img bundle=IMAGE_RESOURCES_KEY height=15 width=15 srcKey=default.unchecked / /logic:notMatch /logic:present logic:notPresent name=bean logic:notPresenthtml:img bundle=IMAGE_RESOURCES_KEY height=15 width=15 srcKey=default.unchecked / /logic:notPresent --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (708) 570-2772 Fax MSN: mickknutson ICQ: 316498480 ICQ URL: http://wwp.icq.com/316498480 ---
[OT]Keel
Hi anyone tried Keel out yet? Reason why I'm asking here is because this mailing list is so active... NOTICE: This message contains privileged and confidential information intended only for the person or entity to which it is addressed. Any review, retransmission, dissemination, copy or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient, is prohibited. If you received this message in error, please notify the sender immediately by e-mail, facsimile or telephone and thereafter delete the material from any computer. The New Africa Capital Group, its subsidiaries or associates do not accept liability for any personal views expressed in this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT]Keel
What is the url? --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (708) 570-2772 Fax MSN: mickknutson ICQ: 316498480 ICQ URL: http://wwp.icq.com/316498480 --- - Original Message - From: Butt, Dudley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 10, 2003 7:31 AM Subject: [OT]Keel Hi anyone tried Keel out yet? Reason why I'm asking here is because this mailing list is so active... NOTICE: This message contains privileged and confidential information intended only for the person or entity to which it is addressed. Any review, retransmission, dissemination, copy or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient, is prohibited. If you received this message in error, please notify the sender immediately by e-mail, facsimile or telephone and thereafter delete the material from any computer. The New Africa Capital Group, its subsidiaries or associates do not accept liability for any personal views expressed in this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tools for Testing
If the struts example could come with examples on how test cases could be written, that will help novices like us. Will having test cases within struts example be beyond the scope? -Original Message- From: Shane Mingins [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 10:29 PM To: 'Struts Users Mailing List' Subject: RE: Tools for Testing Also Canoo WebTest is a free open source tool for automated testing of web applications. http://webtest.canoo.com/webtest/manual/WebTestHome.html I am not sure how that compares with HtmlUnit? I had a quick look at StrutsTestCase but (as a novice) could not see how to use it to develop the Struts layer of my application test-first. Shane -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Friday, 10 October 2003 3:22 p.m. To: Struts Users Mailing List Subject: Re: Tools for Testing Adam Hardy wrote: OH NO! Now I have no excuse to ignore testing anymore! Is anybody out there using strutstestcase in anger? So Vic, openSTA - it's for scripting HTTP tests? I read the homepage and it looked like I'd have to do alot of digging to find the basics - how on earth does it verify the test results? Do you scan the returned page? If you're after validating the contents of the returned page, take a look at htmlunit at SourceForge. It turns the response into a sort of DOM that makes finding things pretty easy, and lets you modify field values and click the submit button, and review the result, to simulate a multi-request user interaction. Adam Craig On 10/09/2003 03:58 AM Vic Cekvenich wrote: I just switched to openSTA.sf.net (on a client tip ;-) Nguyen, Hien wrote: Take a look at StrutsTestCase for Junit at www.junit.org. -Original Message- From: Dirk Behrendt [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 07, 2003 5:07 AM To: [EMAIL PROTECTED] Subject: Tools for Testing Hello! There are tools for automatic testing the Struts application? Dirk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Is Java Overkill?
On 10/10/2003 01:18 PM Mark Galbreath wrote: http://www.sys-con.com/Java/article.cfm?id=2257 Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] He must have been turned down by Sun for a grant. And as for his students, they're obviously a bad year. -- struts 1.1 + tomcat 5.0.12 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to use tiles for Error Pages?
I've been able to use tiles for most of my pages, but how can I use it for an error page, like 404.jsp or 500.jsp? For my normal pages, I've declared them in my tiles-config.xml and then the JSP is quite simple, and that is all working fine. Since I need to define my error pages in my web.xml, that has no knowledge of tiles or even struts, so the error page must be complete without a tiles definition. How can I specify in the actually JSP to reference/extends the track.default definition? tiles-definitions definition name=track.default path=/tiles/defaultLayout.jsp put name=titleKey / put name=header value=/common/header.jsp/ put name=body / put name=nav value=/common/nav.jsp/ put name=footer value=/common/footer.jsp/ /definition /tiles-definitions I tried a 404.jsp like this: %@ 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-tiles.tld prefix=tiles % tiles:insert beanName=track.default beanScope=request put name=titleKey value=title.404/ put name=body 404 /put /tiles:insert But I'm getting this Exception: Oct 10, 2003 10:34:14 AM EDT Error HTTP [WebAppServletContext(244212,track,/track)] Root cause of ServletException javax.servlet.jsp.JspException: Error - Tag Insert : No value defined for bean 'track.default' with property 'null' in scope 'request'. at org.apache.struts.taglib.tiles.InsertTag.processBean(InsertTag.java:667) at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:491) at org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:451) at jsp_servlet.__404._jspService(__404.java:106) I'm confused as where to look next. Any help would be appreciated. Thanks. Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Really OT] Fw: Error in my DBUnit import syntax
I am very sorry for this off topic posting, but after a week, there is just no response, nor much traffic on the DBUnit site to help with this. Maybe someone here is using DBUnit and could help me figure out this issue. I am getting an error importing my DB.xml file. I export it, then try to import it again just for checking out the product. I am using MySql 3 not 4 and not inodb. here is my ant script: Export: target name=dbunitexport depends=build_unittest dbunit driver=${db.driver} url=${db.url} userid=${db.username} password=${db.password} export dest=${class.unittest.dir}/${db.exportfile} format=xml / /dbunit /target Import: target name=dbunitimport depends=junittest dbunit driver=${db.driver} url=${db.url} userid=${db.username} password=${db.password} operation type=UPDATE src=${class.unittest.dir}/${db.exportfile} format=xml / /dbunit /target ERROR: BUILD FAILED file:C:/Documents and Settings/Owner/My Documents/My Data/Projects/YourSos/build.xml:589: org.dbunit.DatabaseUnitException: java.sql.SQLException: Syntax error or access violation, message from server: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'where alert_id = '7595c950c0a801020019a9d17d814d51' and contact --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (708) 570-2772 Fax --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts and Tomcat JDBC Realms
On 10/10/2003 01:46 PM Michel Bertrand wrote: Hi all ! I was woundering about using Struts in Tomcat with JDBC Realms. I found lots of topics about Strunts and Realms but using policy files and I did not find any question or topic involving struts and JDBC Reals. Does struts support the use of JDBC Realms in Tomcat ? I don't intent to use it to proctect my Actions, but to protect my jsp pages under some specific app directories. I tried to implement this running Tomcat in Security Mode but I have some SecurityExceptions in some actions. Is it common ? Could I solve it setting priviledges to struts.jar in my catalina.policy ? And so, does anybody implemented Struts + JDBC Realms + Tomcat ? Yes, many people do! Using a tomcat realm for authentication with standard security-constraints is not normally problematic. Setting up struts to make use of realm authorization (for roles) is child's play (as long as your database contains the roles links to the users). Just put the role attribute in the action mapping in the config. Where when are you getting these exceptions? Also, policy files don't need to come into it at all. Doing anything with priviliges to struts.jar is something I've never heard of. I think you are coming to the subject with a mindset for a different type of authentication authorization system - what you require from tomcat struts is not too complex. Adam -- struts 1.1 + tomcat 5.0.12 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to use tiles for Error Pages?
Eric, If the page isn't accessed through a struts action, you need to insert the tiles definition before your tiles:insert commands like so: tiles:insert definition=track.default/ Regads, David -Original Message- From: Fenderbosch, Eric [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 10:39 AM To: [EMAIL PROTECTED] Subject: How to use tiles for Error Pages? I've been able to use tiles for most of my pages, but how can I use it for an error page, like 404.jsp or 500.jsp? For my normal pages, I've declared them in my tiles-config.xml and then the JSP is quite simple, and that is all working fine. Since I need to define my error pages in my web.xml, that has no knowledge of tiles or even struts, so the error page must be complete without a tiles definition. How can I specify in the actually JSP to reference/extends the track.default definition? tiles-definitions definition name=track.default path=/tiles/defaultLayout.jsp put name=titleKey / put name=header value=/common/header.jsp/ put name=body / put name=nav value=/common/nav.jsp/ put name=footer value=/common/footer.jsp/ /definition /tiles-definitions I tried a 404.jsp like this: %@ 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-tiles.tld prefix=tiles % tiles:insert beanName=track.default beanScope=request put name=titleKey value=title.404/ put name=body 404 /put /tiles:insert But I'm getting this Exception: Oct 10, 2003 10:34:14 AM EDT Error HTTP [WebAppServletContext(244212,track,/track)] Root cause of ServletException javax.servlet.jsp.JspException: Error - Tag Insert : No value defined for bean 'track.default' with property 'null' in scope 'request'. at org.apache.struts.taglib.tiles.InsertTag.processBean(InsertTag.java:667) at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:491 ) at org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:451) at jsp_servlet.__404._jspService(__404.java:106) I'm confused as where to look next. Any help would be appreciated. Thanks. Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT]Keel
http://www.keelframework.org -Original Message- From: Butt, Dudley Sent: Friday, October 10, 2003 4:32 PM To: '[EMAIL PROTECTED]' Subject: [OT]Keel Hi anyone tried Keel out yet? Reason why I'm asking here is because this mailing list is so active... NOTICE: This message contains privileged and confidential information intended only for the person or entity to which it is addressed. Any review, retransmission, dissemination, copy or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient, is prohibited. If you received this message in error, please notify the sender immediately by e-mail, facsimile or telephone and thereafter delete the material from any computer. The New Africa Capital Group, its subsidiaries or associates do not accept liability for any personal views expressed in this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] NOTICE: This message contains privileged and confidential information intended only for the person or entity to which it is addressed. Any review, retransmission, dissemination, copy or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient, is prohibited. If you received this message in error, please notify the sender immediately by e-mail, facsimile or telephone and thereafter delete the material from any computer. The New Africa Capital Group, its subsidiaries or associates do not accept liability for any personal views expressed in this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
help with requiredIf validation
I have the following requiredIf that does not seem to actually work: field property=phone1 depends=required,minlength,maxlength arg0 key=form.phone1/ arg1 name=maxlength key=${var:maxlength} resource=false/ var var-nameminlength/var-name var-value2/var-value /var var var-namemaxlength/var-name var-value32/var-value /var /field field property=phone1type depends=requiredif arg0 key=form.phone1type/ var var-namefield[0]/var-name var-valuephone1/var-value /var var var-namefieldTest[0]/var-name var-valueNOTNULL/var-value /var /field field property=phone2 depends=minlength,maxlength arg0 key=form.phone1/ arg1 name=maxlength key=${var:maxlength} resource=false/ var var-nameminlength/var-name var-value2/var-value /var var var-namemaxlength/var-name var-value32/var-value /var /field field property=phone2type depends=requiredif arg0 key=form.phone2type/ var var-namefield[0]/var-name var-valuephone2/var-value /var var var-namefieldTest[0]/var-name var-valueNOTNULL/var-value /var /field I have tried amking the phone reuired, and also not having the phone required. Here are the HTML elements. 1 is a text field, the other is a drop down: html:text property=phone1 size=32 maxlength=32 / then the dropdown is in a tile for re-usabilty: html:select property='%= beanName + type %' html:option value= key=form.select/ html:option value=home key=form.phone.type.home / html:option value=work key=form.phone.type.work / html:option value=fax key=form.phone.type.fax / html:option value=sms key=form.phone.type.sms / html:option value=mobile key=form.phone.type.mobile / html:option value=pager key=form.phone.type.pager / /html:select Is the fact that the form.select option is ? --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (708) 570-2772 Fax MSN: mickknutson ICQ: 316498480 ICQ URL: http://wwp.icq.com/316498480 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to use tiles for Error Pages? [SOLVED]
Thanks! This works: %@ 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-tiles.tld prefix=tiles % tiles:insert definition=track.default tiles:put name=titleKey value=title.404/ tiles:put name=body type=String 404 /tiles:put /tiles:insert -Original Message- From: David G Friedman [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 10:46 To: Struts Users Mailing List Subject: RE: How to use tiles for Error Pages? Eric, If the page isn't accessed through a struts action, you need to insert the tiles definition before your tiles:insert commands like so: tiles:insert definition=track.default/ Regads, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot find BEAN in any scope
I get this error when trying to use a bean write tag... Cannot find bean org.apache.struts.taglib.html.BEAN in any scope org.apache.jasper.JasperException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) . . . Does this mean I have something set up incorrectly? I'm not sure what to make of this error. Any help is greatly appreciated. - Do you Yahoo!? The New Yahoo! Shopping - with improved product search
Processing a 'POST' from the JSP Page for an ArrayList?
I'm new to struts and so far love it, but this piece is killing me. I have a jsp, form bean, view, action. I am ok with loading an arraylist and embedding it into the jsp page using the iterate. Now, I want to make changes to the table in the browser which is represented as an iterator, and then I would like to get access to these changes back in my action class. Currently, the action class sees the original view and not the updated view. Here are some code snippets. JSP - html:form action=DeleteAwards?Method=DeleteAward . . logic:iterate name=awardMasResultsForm property=awards id=AwardMasView . . TD VALIGN=MIDDLE ALIGN=LEFT class=cell bean:write name=AwardMasView property=safAwdNameShort/ /TD TD VALIGN=MIDDLE ALIGN=CENTER class=cell html:checkbox name=AwardMasView property=deleteRecord value=delete indexed=true/ /TD Action Class - List awards = ((AwardMasResultsForm)form).getAwards(); AwardMasView awardView = (AwardMasView)awards.get(1); Iterator i = awards.iterator(); // this allows you to loop thru the Arraylist while (i.hasNext()) { AwardMasView awardmas = (AwardMasView)i.next(); // get a copy of an AwardMas bean from the list System.out.println(awardmas.getSafAwardCode()); //would like to see changed value here System.out.println(JLB -delete + awardmas.getDeleteRecord()); // would like to see changed value here } Let me know if I can offer anything else to help with this. :) Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot find BEAN in any scope
Generally this means you did not specify the name properly i.e. bean:write name=MyForm property=whatever/ Where MyForm= your formbean name property (or any bean stuffed in your request for that matter) -Original Message- From: Pat Young [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 11:22 AM To: [EMAIL PROTECTED] Subject: Cannot find BEAN in any scope I get this error when trying to use a bean write tag... Cannot find bean org.apache.struts.taglib.html.BEAN in any scope org.apache.jasper.JasperException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 48) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) . . . Does this mean I have something set up incorrectly? I'm not sure what to make of this error. Any help is greatly appreciated. - Do you Yahoo!? The New Yahoo! Shopping - with improved product search This message and its contents (to include attachments) are the property of Kmart Corporation (Kmart) and may contain confidential and proprietary information. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on information contained herein is strictly prohibited. Unauthorized use of information contained herein may subject you to civil and criminal prosecution and penalties. If you are not the intended recipient, you should delete this message immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
force download on excel file when clicked on
Is there a way to foce download when a linked is click to download a excel file rather than opening into the current browser window. For zip or exe it will automatically force a download of the type. I tried changing the mime types but didn't seem to work. Thanks for any information. Joseph This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ot] Time format and time picking?
I need the ability to have a user choose their own Time. But, I can only seem to get 24 hour time to work. So, Either I need to find a JavaScript Time Chooser, or I need help to figure out how to convert the time (8:56PM) to the Military time. Any help on this? --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (708) 570-2772 Fax MSN: mickknutson ICQ: 316498480 ICQ URL: http://wwp.icq.com/316498480 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: force download on excel file when clicked on
Joseph Sze [EMAIL PROTECTED] wrote: Is there a way to foce download when a linked is click to download a excel file rather than opening into the current browser window. For zip or exe it will automatically force a download of the type. I tried changing the mime types but didn't seem to work. Thanks for any information. I speak as a newbie here, but I wonder if there is a way to setup struts-config.xml to expect an action that looks something like /whatever.xls, and then map that to a servlet that would create an excel file. I know that Internet Exploiter plays a lot friendlier when the mime type is actually a part of the URL (.xls in this case), so that might be a way. I would like to hear what some of the other more seasoned Struts developers would think of such a concept. If this won't work at all -- my bad! Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HashMap with options
Hi Can i use HashMap with options? something like: bean:define id=statusFilters property=statusFilters type=java.util.HashMap / html:options collection=statusFilters property=key labelProperty=value/ such that the option value is the key and the labelProperty is the value? thanks M
Re: defaullt selection of radio button
HI You will be assigning values for every radio butttons right, give one of those values as the iniatilization parameter for the property you have assosciated with the radio button in the bean. I mean String prop = x; html:radio property=prop value=y / html:radio property=prop value=x/ after that second radio with value x will be selected. E.FAISAL From: Sunil Sharma \(C\) [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: defaullt selection of radio button Date: Fri, 10 Oct 2003 18:55:59 +0530 Group, I had some radio buttons. There is requirement to auto select one of the button by default. Can any body give me some pointers how can I do that Thanks in advance Sunil _ Talk to Karthikeyan. Watch his stunning feats. http://server1.msn.co.in/sp03/tataracing/index.asp Download images. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ot] Time format and time picking?
No, I understand how to get the time correct, I am just hoping someone has a utility that will help me do this, as well as convert it back to 12 hour formatted time. Just so I don't have to re-invent the wheel. --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (708) 570-2772 Fax MSN: mickknutson ICQ: 316498480 ICQ URL: http://wwp.icq.com/316498480 --- - Original Message - From: James Mitchell [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, October 10, 2003 9:38 AM Subject: Re: [ot] Time format and time picking? Add 12 to the hour. 8:30 AM == 830 8:30 PM == 2030 1:00 PM == 1300 ...is that what you wanted? -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 770.822.3359 AIM:jmitchtx - Original Message - From: Mick Knutson [EMAIL PROTECTED] To: struts [EMAIL PROTECTED] Sent: Friday, October 10, 2003 11:59 AM Subject: [ot] Time format and time picking? I need the ability to have a user choose their own Time. But, I can only seem to get 24 hour time to work. So, Either I need to find a JavaScript Time Chooser, or I need help to figure out how to convert the time (8:56PM) to the Military time. Any help on this? --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (708) 570-2772 Fax MSN: mickknutson ICQ: 316498480 ICQ URL: http://wwp.icq.com/316498480 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ot] Time format and time picking?
I don't recall any handy dandy utilities for time. Sure, there are plenty for dates, but I don't seem to recall that being requested very often or I just have missed it since it hasn't been a requirement in any of my latest projects. -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 770.822.3359 AIM:jmitchtx - Original Message - From: Mick Knutson [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, October 10, 2003 12:55 PM Subject: Re: [ot] Time format and time picking? No, I understand how to get the time correct, I am just hoping someone has a utility that will help me do this, as well as convert it back to 12 hour formatted time. Just so I don't have to re-invent the wheel. --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (708) 570-2772 Fax MSN: mickknutson ICQ: 316498480 ICQ URL: http://wwp.icq.com/316498480 --- - Original Message - From: James Mitchell [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, October 10, 2003 9:38 AM Subject: Re: [ot] Time format and time picking? Add 12 to the hour. 8:30 AM == 830 8:30 PM == 2030 1:00 PM == 1300 ...is that what you wanted? -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 770.822.3359 AIM:jmitchtx - Original Message - From: Mick Knutson [EMAIL PROTECTED] To: struts [EMAIL PROTECTED] Sent: Friday, October 10, 2003 11:59 AM Subject: [ot] Time format and time picking? I need the ability to have a user choose their own Time. But, I can only seem to get 24 hour time to work. So, Either I need to find a JavaScript Time Chooser, or I need help to figure out how to convert the time (8:56PM) to the Military time. Any help on this? --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (708) 570-2772 Fax MSN: mickknutson ICQ: 316498480 ICQ URL: http://wwp.icq.com/316498480 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot find BEAN in any scope
If you add the actionForm to the session this will disappear. I would be interested if this is the best practice. I do it because it works. Does any one have a better way of handling this or is this the correct way? Shawn
Re: reloading of properties/resources file
You can't. This subject gets beaten to death about once a month. -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 770.822.3359 AIM:jmitchtx - Original Message - From: Richard Raquepo [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, October 10, 2003 6:55 AM Subject: reloading of properties/resources file how can i force the reloading of my properties/resource file in struts? thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RES: Struts and Tomcat JDBC Realms
Hi ! Tks for your answer. Now I understood what's happing (I hope so) ... I have a multipart/form-data and it has in its action a forward to a common text form, like: forward name=List redirect=true path=/list.do/ I believe when it reaches the redirect=true, Struts clear the request attributes and lost my user. So I have the authentication authorization problem that you advised me. Am I right ? I really need to have the parameter redirect because without it I have the MulpartIterator error. How could I workaround this situation ? Is possible to matain the user after the redirect ? And what about setting the roles for my actions ? I could simply do : action path=/upload type=com.ecommerce.album.PhotoUploadAction name=uploadForm scope=request validate=true role=user Here ? input=/album/upload.jsp Thanks in advance and regards ... Michel. -Mensagem original- De: Adam Hardy [mailto:[EMAIL PROTECTED] Enviada em: sexta-feira, 10 de outubro de 2003 11:43 Para: Struts Users Mailing List Assunto: Re: Struts and Tomcat JDBC Realms On 10/10/2003 01:46 PM Michel Bertrand wrote: Hi all ! I was woundering about using Struts in Tomcat with JDBC Realms. I found lots of topics about Strunts and Realms but using policy files and I did not find any question or topic involving struts and JDBC Reals. Does struts support the use of JDBC Realms in Tomcat ? I don't intent to use it to proctect my Actions, but to protect my jsp pages under some specific app directories. I tried to implement this running Tomcat in Security Mode but I have some SecurityExceptions in some actions. Is it common ? Could I solve it setting priviledges to struts.jar in my catalina.policy ? And so, does anybody implemented Struts + JDBC Realms + Tomcat ? Yes, many people do! Using a tomcat realm for authentication with standard security-constraints is not normally problematic. Setting up struts to make use of realm authorization (for roles) is child's play (as long as your database contains the roles links to the users). Just put the role attribute in the action mapping in the config. Where when are you getting these exceptions? Also, policy files don't need to come into it at all. Doing anything with priviliges to struts.jar is something I've never heard of. I think you are coming to the subject with a mindset for a different type of authentication authorization system - what you require from tomcat struts is not too complex. Adam -- struts 1.1 + tomcat 5.0.12 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Please help with this error ???en_US.errors.required???
Thanks for your tips which gave me some idea what to look for. My web.xml is fine. The problem is I have the following in my struts-config.xml, which I copied/pasted from the strust-config.xml in the Struts tiles_documentation examples. Will my application, which uses tiles, breaks at some point if I don't include it as the comment states? !-- Not used by tiles or this website, but needed due to a bug in actual Struts version -- message-resources parameter=org.apache.struts.webapp.tiles.dev1-1.ApplicationResources null=false / Vivien -Original Message- From: Daniel H. F. e Silva [mailto:[EMAIL PROTECTED] Sent: Fri 10/10/2003 1:44 PM To: Struts Users Mailing List Cc: Subject:RE: Please help with this error ???en_US.errors.required??? Hi Vivien, Sorry, but i did not make myself clear. Property you have to check existence in web.xml is application. It has same effect as parameter attribute of message-resources/. So, if you find it there (web.xml), remove it. Hope it helped you. Regards, Daniel. --- Chen, Vivien [EMAIL PROTECTED] wrote: I checked my web.xml and did not see message-resources being defined there. Do you have any other idea where I might do wrong. I am really stuck with this problem now. Vivien -Original Message- From: Daniel H. F. e Silva [mailto:[EMAIL PROTECTED] Sent: Fri 10/10/2003 9:55 AM To: Struts Users Mailing List Cc: Subject: Re: Please help with this error ???en_US.errors.required??? Hi Vivien, Take a look at your web.xml. Maybe you copied it from Struts dist and message-resources was already configured there. As settings in web.xml will override settings in struts-config.xml, classloader can't find resource to be loaded and then you get that messages. Hope i helped you. Kind regards, Daniel. --- Chen, Vivien [EMAIL PROTECTED] wrote: I have a login.jsp which I use DynaValidatorForm. Both the username and password are required fields. When I submited the page without entering these data, I got ???en_US.errors.required??? and ???en_US.errors.required???. It looks like the validation was peformed because I got two error.required messages but I don't understand why it was not able to print the accurate message. please help. Thanks in adavance. In xxxResources.properties: errors.required={0} is required. errors.minlength={0} cannot be less than {1} characters. errors.maxlength={0} cannot be greater than {2} characters. ... In struts-config.xml: form-beans !-- Login form bean -- form-bean name=loginForm type=org.apache.struts.validator.DynaValidatorForm form-property name=username type=java.lang.String/ form-property name=password type=java.lang.String/ /form-bean /form-beans message-resources parameter=xxxResources/ I packaged the xxxResource.properties in my xxx.war: WEB-INF/classes/xxxResources.properties In Validation.xml: form-validation formset form name=loginForm field property=username depends=required,minlength,maxlength arg0 key=prompt.username/ arg1 key=${var:minlength} name=minlength resource=false/ arg2 key=${var:maxlength} name=maxlength resource=false/ var var-namemaxlength/var-name var-value16/var-value /var var var-nameminlength/var-name var-value3/var-value /var /field .. /form - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JavaServer Faces
Chen, Gin wrote: Since JSF is *supposed* to replace Struts, so to speak, This statement is *not* a correct understanding of what is happening! Anyone who claims that doesn't get it. You should absolutely, positively plan on evaluating the use of JavaServer Faces components instead of the Struts HTML tags, and the JSTL tags instead of the corresponding bean and logic tags. Besides being standadized (which means, for example, that you can import and use *anyone's* JavaServer Faces tags, not be stuck with ones that are provided only by Struts), they are more powerful and more functional -- and they work fine in conjunction with Struts based applications. That has nothing to do with whether or not you need the other features of Struts (the core controller mechanisms, plugins, Tiles, Validator, ...) -- which can be used just fine with JavaServer Faces components as well. There is a functionality overlap in the core controller role, and for some people JavaServer Faces will be sufficient by itself. But it's our job as Struts developers to ensure that the gap continues to exist and increases; there's a lot of things required to build good web apps that are not UI components or tags, and are therefore outside the scope of JavaServer Faces and JSTL. Craig McClanahan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Odd Behavior with c:forEach
This creates a menu of 1 - 10 /html-el:select html-el:option value=yearyear/html-el:option c:forEach begin=1 end=10 varStatus=status html-el:option value=${status.count} c:out value=${status.count} / /html-el:option /c:forEach /html-el:select This creates a menu of 1-11 /html-el:select html-el:select property=startyear size=1 c:forEach begin=10 end=20 varStatus=status html-el:option value=${status.count} c:out value=${status.count} / /html-el:option /c:forEach /html-el:select Why doesn't this create a menu of 10-20?? Barry
Odd Behavior with c:forEach
This creates a menu of 1 - 10 /html-el:select html-el:option value=yearyear/html-el:option c:forEach begin=1 end=10 varStatus=status html-el:option value=${status.count} c:out value=${status.count} / /html-el:option /c:forEach /html-el:select This creates a menu of 1-11 /html-el:select html-el:select property=startyear size=1 c:forEach begin=10 end=20 varStatus=status html-el:option value=${status.count} c:out value=${status.count} / /html-el:option /c:forEach /html-el:select Why doesn't this create a menu of 10-20?? Barry
Re: Odd Behavior with c:forEach
Try ${status.index} Quoting Barry Volpe [EMAIL PROTECTED]: This creates a menu of 1 - 10 /html-el:select html-el:option value=yearyear/html-el:option c:forEach begin=1 end=10 varStatus=status html-el:option value=${status.count} c:out value=${status.count} / /html-el:option /c:forEach /html-el:select This creates a menu of 1-11 /html-el:select html-el:select property=startyear size=1 c:forEach begin=10 end=20 varStatus=status html-el:option value=${status.count} c:out value=${status.count} / /html-el:option /c:forEach /html-el:select Why doesn't this create a menu of 10-20?? Barry -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [ot] Time format and time picking?
I don't recall any handy dandy utilities for time. Sure, there are plenty for dates, but I don't seem to recall that being requested very often or I just have missed it since it hasn't been a requirement in any of my latest projects. Wouldn't a combination of java.util.Calendar (for the calculations) and java.text.SimpleDateFormat (for formatting) do the trick just fine? -TPP - This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Odd Behavior with c:forEach
Not status.index you need to add a var='foo' and do: c:out value='${foo}'/ Also, If you want 11-20 you should have begin as 11 not 10. -Tim -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 2:54 PM To: Struts Users Mailing List Subject: Re: Odd Behavior with c:forEach Try ${status.index} Quoting Barry Volpe [EMAIL PROTECTED]: This creates a menu of 1 - 10 /html-el:select html-el:option value=yearyear/html-el:option c:forEach begin=1 end=10 varStatus=status html-el:option value=${status.count} c:out value=${status.count} / /html-el:option /c:forEach /html-el:select This creates a menu of 1-11 /html-el:select html-el:select property=startyear size=1 c:forEach begin=10 end=20 varStatus=status html-el:option value=${status.count} c:out value=${status.count} / /html-el:option /c:forEach /html-el:select Why doesn't this create a menu of 10-20?? Barry -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Is Java Overkill?
Am Freitag, 10. Oktober 2003 13:18 schrieb Mark Galbreath: Am I right this MIT 'technology guru' recommends Visual Basic in favor of Java because 'J2EE is much too complex' and JDBC binding variables have to be accessed by their ordinal position in PreparedStatements? Hm. But then, how does the recommendation of *Perl* fit into all this? The only language that looks the same before and after RSA encryption (Keith Bostic)? Ah, but LISP I know, that question-mark-spicked thing they tormented me and my comrades with in my own academic times. Yes, if a language has no loop constructs, you can counter that by using recursion. Still wonder what that was good for at all, though. What a generally weird point of view, all in all. Never would have guessed that comparing apples to oranges seems to have become an academic discipline nowadays. Or that one could get away with that. -- Chris http://www.sys-con.com/Java/article.cfm?id=2257 Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JavaServer Faces
See.. Anyone reason that this should be kept public is to correct our understanding of what JSF is really about. ;) With the talks of JSF and it's UI/Action like capabilities it is no wonder that we think of it as a possible alternative to Struts. To use it with Struts seems to me as saying that you are using only part of the functionality of JSF. Just like your using part of the functionality of Struts if you use JSTL instead of Bean/Logic tags currently. While it is probably a better solution than the Bean/Logic tags, JSTL is still just and alternative to the integrated Struts Bean/Logic functionality. -Tim -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 2:41 PM To: Struts Users Mailing List Subject: Re: JavaServer Faces Chen, Gin wrote: Since JSF is *supposed* to replace Struts, so to speak, This statement is *not* a correct understanding of what is happening! Anyone who claims that doesn't get it. You should absolutely, positively plan on evaluating the use of JavaServer Faces components instead of the Struts HTML tags, and the JSTL tags instead of the corresponding bean and logic tags. Besides being standadized (which means, for example, that you can import and use *anyone's* JavaServer Faces tags, not be stuck with ones that are provided only by Struts), they are more powerful and more functional -- and they work fine in conjunction with Struts based applications. That has nothing to do with whether or not you need the other features of Struts (the core controller mechanisms, plugins, Tiles, Validator, ...) -- which can be used just fine with JavaServer Faces components as well. There is a functionality overlap in the core controller role, and for some people JavaServer Faces will be sufficient by itself. But it's our job as Struts developers to ensure that the gap continues to exist and increases; there's a lot of things required to build good web apps that are not UI components or tags, and are therefore outside the scope of JavaServer Faces and JSTL. Craig McClanahan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JavaServer Faces
If I culod sepll this mghit mkae snese. -Teem -Original Message- From: Chen, Gin [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 3:09 PM To: 'Struts Users Mailing List' Subject: RE: JavaServer Faces See.. Anyone reason that this should be kept public is to correct our understanding of what JSF is really about. ;) With the talks of JSF and it's UI/Action like capabilities it is no wonder that we think of it as a possible alternative to Struts. To use it with Struts seems to me as saying that you are using only part of the functionality of JSF. Just like your using part of the functionality of Struts if you use JSTL instead of Bean/Logic tags currently. While it is probably a better solution than the Bean/Logic tags, JSTL is still just and alternative to the integrated Struts Bean/Logic functionality. -Tim -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 2:41 PM To: Struts Users Mailing List Subject: Re: JavaServer Faces Chen, Gin wrote: Since JSF is *supposed* to replace Struts, so to speak, This statement is *not* a correct understanding of what is happening! Anyone who claims that doesn't get it. You should absolutely, positively plan on evaluating the use of JavaServer Faces components instead of the Struts HTML tags, and the JSTL tags instead of the corresponding bean and logic tags. Besides being standadized (which means, for example, that you can import and use *anyone's* JavaServer Faces tags, not be stuck with ones that are provided only by Struts), they are more powerful and more functional -- and they work fine in conjunction with Struts based applications. That has nothing to do with whether or not you need the other features of Struts (the core controller mechanisms, plugins, Tiles, Validator, ...) -- which can be used just fine with JavaServer Faces components as well. There is a functionality overlap in the core controller role, and for some people JavaServer Faces will be sufficient by itself. But it's our job as Struts developers to ensure that the gap continues to exist and increases; there's a lot of things required to build good web apps that are not UI components or tags, and are therefore outside the scope of JavaServer Faces and JSTL. Craig McClanahan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Please help with this error ???en_US.errors.required???
Hi Vivien, I think it depends on Struts version you are using. I use 1.1 and everything works fine. Your message-resources/ config tells Struts to look for your resources at package org.apache.struts.webapp.tiles.dev1-1. So, you should have, for instance, this: WEB-INF -- | |--- classes -- | |--- org/apache/struts/webapp/tiles/dev1-1 | | - ApplicationResources.properties If you are not using 1.1, please, upgrade to. If problem still happens, you know how to find us. Hope it was useful. Regards, Daniel. --- Chen, Vivien [EMAIL PROTECTED] wrote: Thanks for your tips which gave me some idea what to look for. My web.xml is fine. The problem is I have the following in my struts-config.xml, which I copied/pasted from the strust-config.xml in the Struts tiles_documentation examples. Will my application, which uses tiles, breaks at some point if I don't include it as the comment states? !-- Not used by tiles or this website, but needed due to a bug in actual Struts version -- message-resources parameter=org.apache.struts.webapp.tiles.dev1-1.ApplicationResources null=false / Vivien -Original Message- From: Daniel H. F. e Silva [mailto:[EMAIL PROTECTED] Sent: Fri 10/10/2003 1:44 PM To: Struts Users Mailing List Cc: Subject: RE: Please help with this error ???en_US.errors.required??? Hi Vivien, Sorry, but i did not make myself clear. Property you have to check existence in web.xml is application. It has same effect as parameter attribute of message-resources/. So, if you find it there (web.xml), remove it. Hope it helped you. Regards, Daniel. --- Chen, Vivien [EMAIL PROTECTED] wrote: I checked my web.xml and did not see message-resources being defined there. Do you have any other idea where I might do wrong. I am really stuck with this problem now. Vivien -Original Message- From: Daniel H. F. e Silva [mailto:[EMAIL PROTECTED] Sent: Fri 10/10/2003 9:55 AM To: Struts Users Mailing List Cc: Subject:Re: Please help with this error ???en_US.errors.required??? Hi Vivien, Take a look at your web.xml. Maybe you copied it from Struts dist and message-resources was already configured there. As settings in web.xml will override settings in struts-config.xml, classloader can't find resource to be loaded and then you get that messages. Hope i helped you. Kind regards, Daniel. --- Chen, Vivien [EMAIL PROTECTED] wrote: I have a login.jsp which I use DynaValidatorForm. Both the username and password are required fields. When I submited the page without entering these data, I got ???en_US.errors.required??? and ???en_US.errors.required???. It looks like the validation was peformed because I got two error.required messages but I don't understand why it was not able to print the accurate message. please help. Thanks in adavance. In xxxResources.properties: errors.required={0} is required. errors.minlength={0} cannot be less than {1} characters. errors.maxlength={0} cannot be greater than {2} characters. ... In struts-config.xml: form-beans !-- Login form bean -- form-bean name=loginForm type=org.apache.struts.validator.DynaValidatorForm form-property name=username type=java.lang.String/ form-property name=password type=java.lang.String/ /form-bean /form-beans message-resources parameter=xxxResources/ I packaged the xxxResource.properties in my xxx.war: WEB-INF/classes/xxxResources.properties In Validation.xml: form-validation formset form name=loginForm field property=username depends=required,minlength,maxlength arg0 key=prompt.username/ arg1 key=${var:minlength} name=minlength resource=false/ arg2 key=${var:maxlength} name=maxlength resource=false/ var var-namemaxlength/var-name var-value16/var-value /var var var-nameminlength/var-name var-value3/var-value /var /field .. /form - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
Re: force download on excel file when clicked on
Am Freitag, 10. Oktober 2003 17:48 schrieb Joseph Sze: Still, it's the MIME type that determines how things are handled. If it helps, I once developed a simple Servlet for solving another guys problem with GZip streams on JSP-INTEREST. For experimental purposes, I added options for overriding the MIME type and changing the Content-Disposition header. It's basically nothing more than a two-hours hack, but if you're interested, you may download the resulting .war file (sources included) from http://www.christianbollmeyer.de/dl?downloadFile=DownloadServlet.war -- Chris. Is there a way to foce download when a linked is click to download a excel file rather than opening into the current browser window. For zip or exe it will automatically force a download of the type. I tried changing the mime types but didn't seem to work. Thanks for any information. Joseph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Odd Behavior with c:forEach
Yes that worked. Thanks Barry - Original Message - From: Chen, Gin [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, October 10, 2003 12:02 PM Subject: RE: Odd Behavior with c:forEach Not status.index you need to add a var='foo' and do: c:out value='${foo}'/ Also, If you want 11-20 you should have begin as 11 not 10. -Tim -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 2:54 PM To: Struts Users Mailing List Subject: Re: Odd Behavior with c:forEach Try ${status.index} Quoting Barry Volpe [EMAIL PROTECTED]: This creates a menu of 1 - 10 /html-el:select html-el:option value=yearyear/html-el:option c:forEach begin=1 end=10 varStatus=status html-el:option value=${status.count} c:out value=${status.count} / /html-el:option /c:forEach /html-el:select This creates a menu of 1-11 /html-el:select html-el:select property=startyear size=1 c:forEach begin=10 end=20 varStatus=status html-el:option value=${status.count} c:out value=${status.count} / /html-el:option /c:forEach /html-el:select Why doesn't this create a menu of 10-20?? Barry -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 1.2 - When?
When we can expect Struts 1.2 Beta? (other then when its ready, can we guess a month?) Thank You, David __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JavaServer Faces
Craig R. McClanahan wrote: There is a functionality overlap in the core controller role, and for some people JavaServer Faces will be sufficient by itself. over-simplification It's not unlike the situation with the JSTL SQL tags. For very simple Model 1 applications, these can be sufficient unto the day. But, for more complex applications, you need to break out the big guns, like iBATIS, Hibernate, or EJB. The JSTL SQL tags didn't obviate other data-access products, and the JSF controller features won't obviate other controller products like Struts. JSTL includes SQL tags for completeness and JSF does the same in respect to a controller feature. /over-simplification -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1.2 - When?
I believe there's an issue with some of the tests right now. Once those are resolved, I believe someone might cut a 1.2.0 release to promote the latest release of the Commons Validator. -Ted. David Farell wrote: When we can expect Struts 1.2 Beta? (other then when its ready, can we guess a month?) Thank You, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts 1.2 - When?
*waits patiently for validWhen* -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 16:07 To: Struts Users Mailing List Subject: Re: Struts 1.2 - When? I believe there's an issue with some of the tests right now. Once those are resolved, I believe someone might cut a 1.2.0 release to promote the latest release of the Commons Validator. -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ugly ugly ugly
The whole use-a-named-property-for-everything is great so that marketing can change the text/copy without involving a HTML/JSP developer, as well as the future ability to I18N a site down the road. However some things just get ugly. Example: Old line of HTML: The FedEx Custom Critical a href=/us/shipping/default.shtmlShipping Toolkit/a enables you to: New lines w/ tags: bean:message key=message.benefit.one/nbsp; a href=bean:message key=href.shippingToolkit/ bean:message key=link.shippingToolkit/ /a nbsp;bean:message key=message.benefit.two/ (I know I could use a html:link tag) Any ideas for making this simpler? Should I just define one large resource like: message.benefits=The FedEx Custom Criticalnbsp;a href=/us/shipping/default.shtmlShipping Toolkit/anbsp;enables you to: Then simply do: bean:message key=message.benefits/ ??? Thanks. Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JavaServer Faces
Thank you, Craig, for the umpteenth time for saying this. Why are so many people still talking about throwing in the Struts towel?! This is open source, is it not? Is it not the job of open source to keep ahead of the standards with great ideas that continue to make our jobs easier, more interesting, more fun, and going where no software has gone before? Is it not from open source that the standards are often based? Do we think that just because JSF is on its way into main stream that it will put an end to all we can possibly ask for as web developers? Has that ever been the case with the latest and greatest standard to come to the table? Have we not already heard of the great things the Struts developers have in mind for the future? If the new standards become all you need, then great! If not, then look to Struts and the Struts team for continuing to give you more. Thank you, Struts developers. Susan Bradeen On 10/10/2003 02:40:32 PM Craig R. McClanahan wrote: Chen, Gin wrote: Since JSF is *supposed* to replace Struts, so to speak, This statement is *not* a correct understanding of what is happening! Anyone who claims that doesn't get it. You should absolutely, positively plan on evaluating the use of JavaServer Faces components instead of the Struts HTML tags, and the JSTL tags instead of the corresponding bean and logic tags. Besides being standadized (which means, for example, that you can import and use *anyone's* JavaServer Faces tags, not be stuck with ones that are provided only by Struts), they are more powerful and more functional -- and they work fine in conjunction with Struts based applications. That has nothing to do with whether or not you need the other features of Struts (the core controller mechanisms, plugins, Tiles, Validator, ...) -- which can be used just fine with JavaServer Faces components as well. There is a functionality overlap in the core controller role, and for some people JavaServer Faces will be sufficient by itself. But it's our job as Struts developers to ensure that the gap continues to exist and increases; there's a lot of things required to build good web apps that are not UI components or tags, and are therefore outside the scope of JavaServer Faces and JSTL. Craig McClanahan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ugly ugly ugly
David Graham wrote: --- Fenderbosch, Eric [EMAIL PROTECTED] wrote: The whole use-a-named-property-for-everything is great so that marketing can change the text/copy without involving a HTML/JSP developer, as well as the future ability to I18N a site down the road. However some things just get ugly. Example: Old line of HTML: The FedEx Custom Critical a href=/us/shipping/default.shtmlShipping Toolkit/a enables you to: New lines w/ tags: bean:message key=message.benefit.one/nbsp; a href=bean:message key=href.shippingToolkit/ bean:message key=link.shippingToolkit/ /a nbsp;bean:message key=message.benefit.two/ (I know I could use a html:link tag) Any ideas for making this simpler? Should I just define one large resource like: message.benefits=The FedEx Custom Criticalnbsp;a href=/us/shipping/default.shtmlShipping Toolkit/anbsp;enables you to: Then simply do: bean:message key=message.benefits/ That's what I would do except use the JSTL version: fmt:message key=message.benefits/ From my experience working with human translators this might be a better approach. Translators like to be able to manipulate word order and punctuation. It is a little more code but I'll argue that it is not any less readable. Most importantly it works with Struts links and will properly encode the URL: applicationResources.properties: message.benefits=The FedEx Custom Criticalnbsp;{0}nbsp;enables ... mainPage.shippingLinkName=Shipping Toolkit Put this at the top of the JSP: fmt:setBundle basename=com.nvisia.training.struts.resources.ApplicationResources/ bean:define name=stLink scope=page html:link action=/shipping bean:message key=mainPage.shippingLinkName/ /html:link /bean:define In the body of the jsp: fmt:message key=message.benefits param value=stLink/ /fmt:message Regards, Evan. -- Evan Schnell, Project Lead nVISIA, Twin Cities Enterprise Architecture and Construction 7701 France Ave. S, Edina, MN 55435 Voice: 952.837.2577 -- Fax: 952.837.2578 -- Mobile: 612.232.5972 smime.p7s Description: S/MIME Cryptographic Signature
Re: Struts 1.2 - When?
Fenderbosch, Eric wrote: *waits patiently for validWhen* Why be patient? Pitch in: http://jakarta.apache.org/struts/faqs/helping.html http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsJobJar And, under the Apache Software License, any interested party can roll a release: http://jakarta.apache.org/struts/releases.html After that, all it takes is a vote of the Committers to make it an official Struts release that we can distribute from Apache/Jakarta. -T. -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 16:07 To: Struts Users Mailing List Subject: Re: Struts 1.2 - When? I believe there's an issue with some of the tests right now. Once those are resolved, I believe someone might cut a 1.2.0 release to promote the latest release of the Commons Validator. -Ted. -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. Get Ready, We're Moving Out!! - http://www.clark04.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JavaServer Faces
Craig R. McClanahan wrote: Craig (who notes that it took Struts nearly three years to get a wide breadth of tools support) Though, the Struts tool explosion coincided with the more general Java tool explosion. If we have GUIs like today's Eclipse and IntelliJ three years ago, we would have seen Struts PlugIns right away. The GUI support for Web applications is a thousand-fold better now than it was three years ago, and the Struts support rode the wave. It would also be fair to say that Struts did much to create the buzz around JSF. If the JSF came out three years ago, tools support would have been a much tougher sell, not to mention the concept of taglibs as UI components. Remember how long it was before we saw much vendor support for JSP 1.2. Times have changed. Meanwhile, as James Holmes mentioned, it's nice to see that some things don't change: open source is still leading the way, with offerings like FacesConsole and Struts-Faces, not to mention MyFaces on SourceForge. (Pity about the license.) Also as mentioned elsewhere, initiatives like JSF don't appear out of thin air, they are built on a path paved by open source. And, the road winds ever on ... -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Is Java Overkill?
I have to admit, there are days when I would tend to agree : MIT is a place where they take pride in trying to invent the future. Something we should all keep in mind is that our world is still young. We've only scratched the surface, and there's a lot of future left to invent. No matter how we decide to do something today, we'll be doing it differently ten years from now. (And, dammit, I *still* won't be eligible for retirement!) -Ted. -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. Get Ready, We're Moving Out!! - http://www.clark04.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ugly ugly ugly
Is fmt:message a complete replacement for b:message? What do I have to know to use it? -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 4:35 PM To: Struts Users Mailing List Subject: Re: ugly ugly ugly ... That's what I would do except use the JSTL version: fmt:message key=message.benefits/ ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JavaServer Faces
I think the main point is that JSF is primarily about standard re-usable user interface components. It has basic controller functionality, but the UI component side of things is the real focus. Many existing frameworks -- Struts, UIX (Oracle's framework), and others, will continue to add a bunch of additional functionality but will also be able to use JSF components. That's the bottom line. And, like Ted and Craig said, smaller applications may do fine with JSF alone. At 04:03 PM 10/10/2003 -0400, you wrote: Craig R. McClanahan wrote: There is a functionality overlap in the core controller role, and for some people JavaServer Faces will be sufficient by itself. over-simplification It's not unlike the situation with the JSTL SQL tags. For very simple Model 1 applications, these can be sufficient unto the day. But, for more complex applications, you need to break out the big guns, like iBATIS, Hibernate, or EJB. The JSTL SQL tags didn't obviate other data-access products, and the JSF controller features won't obviate other controller products like Struts. JSTL includes SQL tags for completeness and JSF does the same in respect to a controller feature. /over-simplification -Ted. Kito D. Mann Author, JSF in Action www.JSFCentral.com - JSF FAQ, news, and info - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ugly ugly ugly
--- Derek Richardson [EMAIL PROTECTED] wrote: Is fmt:message a complete replacement for b:message? What do I have to know to use it? Yes. fmt:message is part of the JSTL http://java.sun.com/products/jsp/jstl/ David -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 4:35 PM To: Struts Users Mailing List Subject: Re: ugly ugly ugly ... That's what I would do except use the JSTL version: fmt:message key=message.benefits/ ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JavaServer Faces
Am Freitag, 10. Oktober 2003 21:09 schrieb Chen, Gin: If I also may share my thoughts about this all here: Well, I'm doing not only Java or J2EE, but was alo forced upon the role of chief developer for our 'main' product (which is a traditional C/S application written in Delphi) some time ago. Now Object Pascal definitely has its lackings from a designer's view (unlike Java, it has no interface datatype rsp. interface means: COM interface, at least something with GUIDs associated), but one thing has really converted me from being a C++ addict; formerly convinced that the power lies in language constructs; and that's the inherent power of Components itself. When coding for Delphi, Compo- nents are just everywhere, and Object Pascal, as most Apple innovations, is a truly powerful OO language. You can do great things in Delphi. The downside, still, is that Components don't make you a better developer, so there's a lot of room for those quick- and-dirty hackers usually located more in the VB direction. That's the drawback of ease-of-use: you also leave room for the otherwise-illicits. But that's just the trade-off of abstraction in general. Still: Components are the future, if you like it or not, things are generally tending the more to the abstract the more complicated the under- lying problems and technologies get. It is basically inevitable, as the restrictions of the human mind necessarily require abstraction (as it can handle just up to seven different topics at a time; this is rather well-researched by other disciplines) demand for this. Now look at UML and the MDA approach that is currently the flagship of OMG. Look at both J2EE and .NET. Both technologies were clearly influenced by a book named 'Business Component Factory' released in 1997 (as I lend it to a friend, I fail to cite the authors here), but it's important nonetheless. Note that Components don't mean Delphi Components (which are basically just normal Object Pascal classes) J2EE beans, COM objects or something like this, but may deal with entire, pre-fabricated encapsu- lations of common business processes in a standard way. Components, though there's no common definition for this term, are the next step in evolution to the OO paradigm (and be honest and ask yourself - ten years ago, what did you really think about Objects and C++?) I personally remember times when I thought C was a commodity language for lusers who didn't know Assembler, held C++ for being inferior to C for the resulting .exes being bigger and everything seemed to be much more complicated and the like. I've personally seen all this before. The last time when I had just the same feeling was when JSTL was released and Java scriptlets became more or less 'banned' in terms of proper coding. This was in 2002, actually. Though I didn't like it at first (I'm a Java developer in the first place, and developers write code, wasn't it so?), I more and more acknowledged the value of the JSTL approach, ending up in recently issuing an internal rule that all scriptlet code should be banned from all View pages in favor of JSTL tags unless there's a well-justified reason for it. Now, finally ending all this endless line of aphorisms, how does it fit into the Struts and JSF picture I originally wanted to write my thoughts about? Well, to sum it up in short: today, I know, like and favor Struts above all other frameworks, and it's always hard to leave the things behind that have you have become familiar with over time for something better or more advanced. I also admit I don't know very much about JSF yet apart from the basic ideas, but I spot similarities to ASP.NET and it somewhat fits into the general picture explained above, and I somehow suspect it can't be just coincidence that the web tier seems to generally go this way. Then, Craig is the specification lead, after all, and from what I get, he says that it will be good. I have no reason to distrust him or other people in this direction or think I know better. All I can say at this stage is that Struts works fine, it solves my everyday problems in a tightly-bound- to-HTML-and-JSP way, supports a proper MVC architecture if applied right, and so I currently don't feel lacking anything. But then, I was also content with TASM 15 years ago. So, finally, JSF deserve a real chance. From a design standpoint, the overall approach of JSF seems to be superior to a tightly protocol-related imple- mentation like Struts. And whether it's a good thing or not and if it fits our needs, we may decide in about two years. Just my 2 cents, -- Chris. See.. Anyone reason that this should be kept public is to correct our understanding of what JSF is really about. ;) With the talks of JSF and it's UI/Action like capabilities it is no wonder that we think of it as a possible alternative to Struts. To use it with Struts seems to me as saying that you are using only part of the functionality of JSF. Just like your using part of the
RE: ugly ugly ugly
Do I still declare my properties files in struts-config and associate them with keys? Knew it is a part of the JSTL, didn't know it's a drop-in replacement for b:message. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 5:48 PM To: Struts Users Mailing List Subject: RE: ugly ugly ugly --- Derek Richardson [EMAIL PROTECTED] wrote: Is fmt:message a complete replacement for b:message? What do I have to know to use it? Yes. fmt:message is part of the JSTL http://java.sun.com/products/jsp/jstl/ David -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 4:35 PM To: Struts Users Mailing List Subject: Re: ugly ugly ugly ... That's what I would do except use the JSTL version: fmt:message key=message.benefits/ ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
No getter method error
Hello, I am working on my first Struts application and I've run into a problem with reading bean properties with the taglibs. I am using the NetBeans IDE w/j2sdk 1.4.2 and Struts 1.1. OK, this is what I see in my browser: [ServletException in:/tiles/timesheet_viewer.jsp] No getter method for property date of bean day' Here is a chunk of the log file for the Tomcat container: javax.servlet.jsp.JspException: No getter method for property date of bean day at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968) at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:286) at org.apache.jsp.timesheet_0005fviewer$jsp._jspService(timesheet_0005fviewer$jsp.java:128) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) .. .. I've checked the struts-user archives for no getter method and a lot of those threads were caused by problems with property names and their corresponding accessors. I've double-checked my beans and that doesn't seem to be the problem. My getter/setters use the same datatype, I reference date in the tag and my getter is getDate(), I haven't overridden my accessor methods or provided multiple accessors with different signatures My next step will be to take a look at RequestUtils.java:968 to see if that provides me with a clue as to what I'm doing wrong. Thanks for your help. --dennis Here is the chunk from the JSP that is using the logic and bean taglibs. week1 is a WeekBean that holds 7 DayBeans. Each DayBean then has some properties that I would like to display: logic:iterate name=week1 id=day tr tdbean:write name=day property=date//td /tr /logic:iterate Note that this works fine, the toString() method of the DayBean is called and returns the classname: logic:iterate name=week1 id=day tr tdbean:write name=day//td /tr /logic:iterate Next we've got my beans, I've removed some comments and cruft to make this not manageble: public class DatedTimesheetBean extends Vector { /** A string to be used when this bean is displayed. */ private String date = ; /** The total elapsed time (in seconds) of all of the items in this bean. */ private int elapsedSeconds = 0; public DatedTimesheetBean() { } public DatedTimesheetBean(int size) { setSize(size); } public String getDate() { return date; } public void setDate(String d) { date = d; } public int getElapsedSeconds() { return elapsedSeconds; } public void setElapsedSeconds(int s) { elapsedSeconds = s; } public void addElapsedSeconds(int s) { elapsedSeconds += s; } /** * Take the elapsed time value (in seconds) and format it * for display as HH:MM. * @return A String in HH:MM format. */ public String getElapsedTime() { snip return sb.toString(); } } public class WeekBean extends DatedTimesheetBean { private static final int SLOTS = 7; /** Creates a new instance of WeekBean */ public WeekBean() { super(SLOTS); for (int i = 0; i SLOTS; i++) { set(i, new java.util.Vector()); } } public void addDay(DayBean day) { set(day.getDow(), day); } } public class DayBean extends DatedTimesheetBean { private static final int SLOTS = 8; /** The day of the week represented by this DayBean. 0=Sunday, 6=Saturday */ private int dow = 0; /** Keeps track of the number of slots we have available for events. */ private int slotCounter = 0; /** Creates a new instance of DayBean */ public DayBean() { super(SLOTS); for (int i = 0; i SLOTS; i++) { set(i, 00:00); } } /** Set the day-of-week value for this bean. */ public void setDow(int i) { dow = i; } public int getDow() { return dow; } public String toString() { return this.getClass().toString(); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ugly ugly ugly
--- Derek Richardson [EMAIL PROTECTED] wrote: Do I still declare my properties files in struts-config and associate them with keys? Yes, and add this to you web.xml file so fmt:message will also know where to find your messages: context-param param-namejavax.servlet.jsp.jstl.fmtlocalizationContext/param-name param-valuecom.yourcorp.Resources/param-value /context-param David Knew it is a part of the JSTL, didn't know it's a drop-in replacement for b:message. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 5:48 PM To: Struts Users Mailing List Subject: RE: ugly ugly ugly --- Derek Richardson [EMAIL PROTECTED] wrote: Is fmt:message a complete replacement for b:message? What do I have to know to use it? Yes. fmt:message is part of the JSTL http://java.sun.com/products/jsp/jstl/ David -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 4:35 PM To: Struts Users Mailing List Subject: Re: ugly ugly ugly ... That's what I would do except use the JSTL version: fmt:message key=message.benefits/ ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OT - book on Java patterns
All this talk lately of various official patterns has my brain hurting from the Unknown again. Can anyone recommend a good book on *patterns* - business delegate, visitor, dao, etc. etc. etc. Thanks, -Sasha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OT - book on Java patterns
I think this is a good J2EE-oriented one; has some very practical examples if you are new to patterns. Core J2EE Patterns: Best Practices and Design Strategies by Deepak Alur (Author), John Crupi (Author), Dan Malks (Author) http://www.amazon.com/exec/obidos/tg/detail/-/0130648841/qid=1065824709/sr=1-1/ref=sr_1_1/102-8497913-0007360?v=glances=books Scott -Original Message- From: Sasha Borodin [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 5:23 PM To: Struts Users Mailing List Subject: OT - book on Java patterns All this talk lately of various official patterns has my brain hurting from the Unknown again. Can anyone recommend a good book on *patterns* - business delegate, visitor, dao, etc. etc. etc. Thanks, -Sasha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HTTP Status 404 After Inserting security-constraint In The web.xml
I think this is more of a problem in the area of Servlets/JSPs. Nonetheless, it happened when I ran my Struts application and I decided to give a try at this forum. My application worked well with login-config auth-methodFORM/auth-method form-login-config form-login-page/signin/logon.jsp/form-login-page form-error-page/signin/logon.jsp?error=true/form-error-page /form-login-config /login-config in the web.xml file. Thereafter,I inserted security-constraint preceding the login-config element, and inserted security-role following the login-config element. The application stopped functioning. I got: HTTP Status 404 -/PracticeVersion description: The requested resource(/PracticeVersion) is not availabe. in the browser, and I have this message in the Tomcat log file: LifecycleException: Container StandardContext[/PracticeVersion] has not been started This was what my web.xml looked like when the problem happened: security-constraint web-resource-collection web-resource-nameAdministrative/web-resource-name !-- The URLs to protect -- url-pattern/do/admin/*/url-pattern /web-resource-collection auth-constraint !-- The authorized users -- role-nameadministrator/role-name role-namecontributor/role-name /auth-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page/signin/logon.jsp/form-login-page form-error-page/signin/logon.jsp?error=true/form-error-page /form-login-config /login-config security-role role-nameadministrator/role-name /security-role security-role role-namecontributor/role-name /security-role __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Keeping Actions clean - separating actions from business model from persistence
Ted, Matt, Joe, and all the other helpful folks that chimed in earlier on persistence mechanisms: In trying to keep with best practices, I've managed to remove all model related code (business logic, and persistence) out of the Actions' execute() method. Now I'd like to take it one step further and decouple the business model classes from the implementing persistence technology (btw, settled on OJB for now :). From Joe's post, it seems like the DAO pattern is called for to accomplish this. My (slightly off topic) question is this: who develops their own DAO framework (like the dao and dao factory interfaces), and who uses a 3rd party framework (like iBATIS's Database Layer) and why? There was something mentioned about the discovery of the persistence mechanism as well... Any references to webpages/books would be appreciated. BTW, I've been shamelessly posting to this list questions that are probably better directed elsewhere. What would be a more appropriate list? Thank you, -Sasha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to keep developing time as short a possible?
I think I have a good practice: Point Resin (or container) to your project where IDE is: web-app id='/' document-directory='\jasic\bPproj\bP' Cany changes to Java or JSP, you do not need to restart resin. (changes to xml files, you do). I also recomend dual mointors, resin console and browser on right; Eclipse front and center. As soon as I save an action java file, for example, I can go to left monitor w/mouse, browse the action, and new debnug messages display in resin console. Eclipse detects a change, and creates a class file. Resin detects the change, and reloads the new class. hth, .V [EMAIL PROTECTED] wrote: Hi all, I'm a J2EE developer. I have made a few projects using Struts. And I have to say I like the Struts framework very much. I'm using XDoclet to generate struts-config.xml (to speed up development). The only thing I'm not happy about is the following: 1. I change something in my JSP. 2. Run Ant (create a war and ear). 3. Deploy the ear - file. 4. See the results in the browser. (JSP has to get compiled). Unfortunatly these four steps take at least (in my case) 3 minutes for each run. Is there some way to check my JSP before compiling it? Or some other way to keep the time as short as possible? Many thanks, Harm de Laat Informatiefabriek The Netherlands - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Keeping Actions clean - separating actions from business modelfrom persistence
I use my own framework because I don't know any better. I am using Torque as my underlying persistence mechanism, and I have introduced a very simple level of indirection that I think should keep me independent of Torque in the future (I plan to swap in Hibernate or OJB on the next app I work on). The level of indirection I introduced is encapsulated in an object I call the DaoManager. The DaoManager is created by a Factory class that gives me an instance of the DaoManager that works for my particular application. Right now my Factory is creating a DaoManager that works with Torque, but in the future it will create one that works with Hibernate or OJB. (More info on the Factory pattern is in the Gang of Four book, not the J2EE core patterns book someone recommended to Sasha earlier today). public interface IRecordDao { public BigDecimal getId(); public void setId(BigDecimal id); } public abstract class DaoManager { public abstract IRecordDao createDao(Connection conn, String daoClassName) throws DaoException; public abstract IRecordDao getDao(Connection conn, String daoClassName, BigDecimal id) throws DaoException; public abstract void saveDao(Connection conn, IRecordDao record) throws DaoException; public abstract void removeDao(Connection conn, String daoClassName, BigDecimal id) throws DaoException; } As you may have noticed, this technique introduces the constraint that each DAO must have a single numeric primary key. This is not an onerous constraint, but may be an issue in an existing database where introducing surrogate keys would cause problems. I am interested in this topic so I may do some research this weekend to see if I can think of a better way than I am currently using. I don't know if there's a better list to discuss this type of thing... so far this seems to be a pretty good one :) You might want to prefix your messages with [OT] (off-topic) if you aren't sure if they are appropriate for the list. Matt - Original Message - From: Sasha Borodin [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, October 10, 2003 6:44 PM Subject: Keeping Actions clean - separating actions from business modelfrom persistence Ted, Matt, Joe, and all the other helpful folks that chimed in earlier on persistence mechanisms: In trying to keep with best practices, I've managed to remove all model related code (business logic, and persistence) out of the Actions' execute() method. Now I'd like to take it one step further and decouple the business model classes from the implementing persistence technology (btw, settled on OJB for now :). From Joe's post, it seems like the DAO pattern is called for to accomplish this. My (slightly off topic) question is this: who develops their own DAO framework (like the dao and dao factory interfaces), and who uses a 3rd party framework (like iBATIS's Database Layer) and why? There was something mentioned about the discovery of the persistence mechanism as well... Any references to webpages/books would be appreciated. BTW, I've been shamelessly posting to this list questions that are probably better directed elsewhere. What would be a more appropriate list? Thank you, -Sasha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JavaServer Faces
Susan Bradeen wrote: Thank you, Craig, for the umpteenth time for saying this. Why are so many people still talking about throwing in the Struts towel?! This is open source, is it not? Is it not the job of open source to keep ahead of the standards with great ideas that continue to make our jobs easier, more interesting, more fun, and going where no software has gone before? Is it not from open source that the standards are often based? A historical note that supports what Susan (and Ted) are saying here. During the planning for what became JSTL 1.0, I was advocating the inclusion of an expression language in whatever tags we came up with, because it's a key ease-of-use feature compared to the clunkiness of expressing functional logic in XML. The strongest piece of my argument: Struts users who are used to the power of expression evaluation won't accept standard tags that don't have this functionality. :-) Now, we've got EL expressions not only in tags that understand them, but (as of JSP 2.0) EL expressions work everywhere in your page -- even in template text. And the expectations of Struts users, setting the bar pretty high, had a lot to do with that. Do we think that just because JSF is on its way into main stream that it will put an end to all we can possibly ask for as web developers? Has that ever been the case with the latest and greatest standard to come to the table? Have we not already heard of the great things the Struts developers have in mind for the future? If the new standards become all you need, then great! If not, then look to Struts and the Struts team for continuing to give you more. Thank you, Struts developers. For myself (and I'm sure the other developers as well) you're definitely more than welcome. It has been an astonishing three years, and there's lots more fun and interesting stuff to be done. Susan Bradeen Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JavaServer Faces
Frank Maritato wrote: So, displaytag is a pretty interesting taglib. It is very nice, I use it a lot! Does it need to have the entire dataset, or can it use an action/controller to lazy load the information from a datasource (or ejb, or web service, etc.) ? View layer does not deal with data of course, that is for the model. Of course to implement a good model, one should know some SQL. (Doing a good view, one should know CSS, or JavaScript, etc. ) Some DAO's, such iBaits, have pagination. (and caching; also iBatis can return a List, and displaytag needs a List. How nice.) Lazyloading might help in some cases in Java, but it would not help you in SQL/Data side. SQL works on sets (set theory, right; intersections, unions, etc. Read up on Celko) and server side and client side cursors are slow and non scaleable. A given DB engine compiles the querry, selects a path, executes the path with joins, sorts the result and then send it out(this last part you want to be faster?). Some DB engines, such as pgSQL offers support for SELECT . . . LIMIT/OFFSET, so you can get to the 3rd set of 1000 records from your result set. Depending of the DB engine you use, I would ask in the DB forum, since row by row loading (what I think you wanted) is same in C lang as it would be in Java. (CLI, OCI, etc.) I do have a google like example of doing this in a good practice example open source app. bP, If data access is slow for you, I would stress test that layer/module. View should present the collection in a paginated way, but after you have some data. hth, .V Vic Cekvenich wrote: Here is an example of something I do a lot of w/Struts: http://displaytag.sf.net (that Matt contributed to) You can click on examples link (uper right) to see nested, pagination, etc. Using your skill and experience you listed, can you show something similar? .V Kito D. Mann wrote: At 11:20 AM 10/9/2003 -0500, you wrote: I watched a presentation on JSF last night. Here's my high-level impressions: 1. It's a replacement for Struts (no matter what folks say). It may be in the long-term, but it won't be in version 1.0. I think the combination of the two is pretty powerful. 2. It's basically Swing for the Web. True. 3. It's more difficult than Struts. I think it might be more difficult for people who haven't worked with desktop-oriented GUI frameworks like Swing, Delphi's VCL, or Visual Basic OCXs (and likewise .NET). Once you get used to a more component-oriented approach, it's a lot more efficient. Most of the people I know who develop complex desktop GUIs with tools like Delphi feel that the servlet development is a step backwards, even with great frameworks like Struts. I also think that JSF will be easier to swallow than Swing, but that's based on my limited Swing experience (I've done a lot more Delphi desktop development than Swing). Anyway, that's my two cents, as someone who's familiar with JSF and has also worked with Struts, ASP.NET WebForms, and tools like Delphi. This topic has been beat to death all over the place; you can find out more on my site, JSFCentral.com. There's a FAQ there that addresses some Struts/Faces questions. Kito D. Mann Author, JSF in Action Basically, I'm not impressed. I think they're going to have do a lot to make it easier to learn and easier to develop with. It seems that a lot of Experts are touting that it'll be easy to develop because it's a *standard* and IDEs will support it. I'll believe it when I see it considering I still use HTML editors to edit JSPs and JSTL (because Homesite is still the best JSP editor IMO). Read more at http://tinyurl.com/qbyk. These are just my opinions - so take them with a grain of salt. Matt -- Victor Cekvenich, Struts Instructor (215) 312-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Keeping Actions clean - separating actions from business model from persistence
Matt, thanks for your quick feedback. I use my own framework because I don't know any better. public abstract class DaoManager { public abstract IRecordDao createDao(Connection conn, String daoClassName) throws DaoException; Which tier calls your DaoManager? It seems from your code that the caller of DaoManager is responsible to knowing the database configuration information, as well as the implementing DAO class. Is it the Action? In other words, who orchestrates the interaction of business and dao classes? Does the action instantiate a business class and populate it from your ActionForm, then get a dao instance from a factory, and pass it the business class? Or is there another pattern to this? Thanks. Matt -Sasha - Original Message - From: Sasha Borodin [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, October 10, 2003 6:44 PM Subject: Keeping Actions clean - separating actions from business modelfrom persistence Ted, Matt, Joe, and all the other helpful folks that chimed in earlier on persistence mechanisms: In trying to keep with best practices, I've managed to remove all model related code (business logic, and persistence) out of the Actions' execute() method. Now I'd like to take it one step further and decouple the business model classes from the implementing persistence technology (btw, settled on OJB for now :). From Joe's post, it seems like the DAO pattern is called for to accomplish this. My (slightly off topic) question is this: who develops their own DAO framework (like the dao and dao factory interfaces), and who uses a 3rd party framework (like iBATIS's Database Layer) and why? There was something mentioned about the discovery of the persistence mechanism as well... Any references to webpages/books would be appreciated. BTW, I've been shamelessly posting to this list questions that are probably better directed elsewhere. What would be a more appropriate list? Thank you, -Sasha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Keeping Actions clean - separating actions from business mode l from persistence
Hi I have generally have done the following: In the Action: Use a DTO(data transfer object) to transform the ActionForm to a business layer data object Instantiate the business logic class of interest Call a method on the business logic passing the DTO object Depending on the status returned, do the appropriate actionForward call in the action. The action is a client of the business logic. (in case I am not using Struts, but vanilla Servlets, the Servlet replaces the action. the rest till applies). In the Business logic Layer: Apply the necessary business rules. In case of Database persistence, call the persistence manager. ask the persistence manager to persist the data. The business logic shouldn't care how the data is persisted. The standard persistence methods (create, save, findByPrimaryKey,remove,findBy...) are exposed to the Business Logic. The BusinessLogic passes to the Persistence layer objects in the businessdomain (e.g. standard data objects). Primary Keys are encapsulated in a PK class. In the persistence layer store to the datastore by the method of choice (JDBC/any other engine etc.) do the necessary transformation on business data as required by the persistence store. do the reverse when retrieving data from the persistence store. The persistence manager contains the actual classes that know how to store and retrieve data to the persistent store. I have always wondered where is the best place to do connection management with the dataStore. Should the business Logic do connectionManagement (e.g. opening a connection (via a connection pool or otherwise)) or should that be the responsibility of the persistence layer. Doing it in the latter(PersistenceLayer) frees up the BusinessLayer of connection Mgt code. If you are implementing connectionpool, the overhead is the time to return the connection to the pool and get it back. Thoughts are welcome! Mahesh -- Mahesh Joshi W- 408-543-7214 M- 408-829-8051 [EMAIL PROTECTED] -Original Message- From: Sasha Borodin [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 5:33 PM To: Struts Users Mailing List Subject: Re: Keeping Actions clean - separating actions from business model from persistence Matt, thanks for your quick feedback. I use my own framework because I don't know any better. public abstract class DaoManager { public abstract IRecordDao createDao(Connection conn, String daoClassName) throws DaoException; Which tier calls your DaoManager? It seems from your code that the caller of DaoManager is responsible to knowing the database configuration information, as well as the implementing DAO class. Is it the Action? In other words, who orchestrates the interaction of business and dao classes? Does the action instantiate a business class and populate it from your ActionForm, then get a dao instance from a factory, and pass it the business class? Or is there another pattern to this? Thanks. Matt -Sasha - Original Message - From: Sasha Borodin [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, October 10, 2003 6:44 PM Subject: Keeping Actions clean - separating actions from business modelfrom persistence Ted, Matt, Joe, and all the other helpful folks that chimed in earlier on persistence mechanisms: In trying to keep with best practices, I've managed to remove all model related code (business logic, and persistence) out of the Actions' execute() method. Now I'd like to take it one step further and decouple the business model classes from the implementing persistence technology (btw, settled on OJB for now :). From Joe's post, it seems like the DAO pattern is called for to accomplish this. My (slightly off topic) question is this: who develops their own DAO framework (like the dao and dao factory interfaces), and who uses a 3rd party framework (like iBATIS's Database Layer) and why? There was something mentioned about the discovery of the persistence mechanism as well... Any references to webpages/books would be appreciated. BTW, I've been shamelessly posting to this list questions that are probably better directed elsewhere. What would be a more appropriate list? Thank you, -Sasha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
How To Work Out This Action Mapping?
Because there is such a statement (shown below) in my signinForm.jsp: html:form action=j_security_check method=post focus=j_username I put action name=j_security_check path=/do/admin/Menu/ in my struts-config.xml file. When I ran the application, I got: [ServletException in:/article/content/signinForm.jsp] Cannot retrieve mapping for action /j_security_check' I know that I did not specify the action properly. What is the correct way to do it? __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Keeping Actions clean - separating actions from businessmodel from persistence
- Original Message - From: Sasha Borodin [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, October 10, 2003 8:33 PM Subject: Re: Keeping Actions clean - separating actions from businessmodel from persistence Matt, thanks for your quick feedback. I use my own framework because I don't know any better. public abstract class DaoManager { public abstract IRecordDao createDao(Connection conn, String daoClassName) throws DaoException; Which tier calls your DaoManager? It seems from your code that the caller of DaoManager is responsible to knowing the database configuration information, as well as the implementing DAO class. Is it the Action? I have a 4 tier architecture. PRESENTATION TIER - Struts - Action classes BUSINESS TIER - Business Objects INTEGRATION PERSISTENCE TIER - DAO Manager - DAOs - Other database access mechanisms (I do some JDBC using a fancy home-grown SQL building mechanism when dealing with particularly complex queries) RESOURCE TIER - Databases In addition to the 4 tiers, my applications are separated into two parts. One part is a reusable framework that is shared among many applications. The second part is the actual application code that is specific to a single application because of business rules, etc. (Even if you don't need a reusable framework for your work, such a thing can be useful because it allows you to do things like swap out your persistence mechanism without disturbing your presentation code and business objects) A single Abstract Factory (informally called Walmart) is responsible for creating the DAO manager and the business objects in the reusable framework. The application code must define a concrete implementation of the Abstract Factory. This implementation must know how to create a DAO Manager that works with the persistence mechanism being used. So, to finally get around to answering your question, the caller of the DAO manager does not need to know anything about the persistence mechanism used. The DAO manager's job is to hide this information from its clients. True, the application code does need to provide the implementation of the Abstract Factory and an implementation of the DAO manager. However, since the DAO manager is an abstract class, its clients can rely only on the API of the DAO manager rather than relying on the API of the underlying persistence mechanism. Thus the clients of the DAO manager need not know anything about the persistence mechanism being used. So even though the application does have to specify what persistence mechanism is used and how to interact with that mechanism, that definition is in *one place* which means that it can be changed if need be without impacting the business objects. In other words, who orchestrates the interaction of business and dao classes? Does the action instantiate a business class and populate it from your ActionForm, then get a dao instance from a factory, and pass it the business class? Or is there another pattern to this? The exact interactions among the components of course depend on the business rules. A typical use case is that the Action class creates a few DAOs based on information in the request and then passes those DAOs to one of the business objects. The business objects may in turn retrieve other DAOs, create DAOs, or even return DAOs to the Action class for further processing by another business object. Well that was rather long-winded... did I answer your question or go off on a useless tangent? ;) Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HashMap with options
You might want to investigate using a List of LabelValueBean objects instead. Matt - Original Message - From: Manav Gupta [EMAIL PROTECTED] To: Struts Developers (E-mail) [EMAIL PROTECTED] Sent: Friday, October 10, 2003 12:24 PM Subject: HashMap with options Hi Can i use HashMap with options? something like: bean:define id=statusFilters property=statusFilters type=java.util.HashMap / html:options collection=statusFilters property=key labelProperty=value/ such that the option value is the key and the labelProperty is the value? thanks M - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How To Work Out This Action Mapping?
I think you may be doing two things wrong: 1. j_security_check is a special URL. If you have a security realm defined in your web application, and authentication method specified as FORM, then the container will automatically forward any requests for protected resources to a configurable login form. This login form collects the username and password, and posts to this special URL; the post to j_security_check gets intercepted by your servlet container, which performs Container Managed Authentication - it looks for the j_username and j_password, authenticates the combination, and forwards to the originally requested resource, or to a configurable error page if the authentication fails. All this to say that you can not map an action to j_security_check. Furthermore, you can't even aggressively authenticate using CMA (Container Managed Authentication) - if you go directly to your login page (without being forwarded there by you container), and try to submit the form, you'll get an error. 2. If you were trying to map a legitimate URL, then you'd have your action properties wrong. action path=/someLegitimatePath type=your.action.class name=name of a previously defined ActionForm if needed for this action /action HTH, -Sasha On 10/10/03 20:21, Caroline Jen [EMAIL PROTECTED] wrote: Because there is such a statement (shown below) in my signinForm.jsp: html:form action=j_security_check method=post focus=j_username I put action name=j_security_check path=/do/admin/Menu/ in my struts-config.xml file. When I ran the application, I got: [ServletException in:/article/content/signinForm.jsp] Cannot retrieve mapping for action /j_security_check' I know that I did not specify the action properly. What is the correct way to do it? __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How To Work Out This Action Mapping?
Thank you for your reply. I am using container managed authentication. My problem is how to go from j_security_check back to my Struts framework. I have my Tomcat JDBCRealm configured and users, user_roles tables prepared in the database. In my struts-config.xml file, I did this forward when users click on the LOGON button: forward name=logon path=/signin/logon.jsp/ and in my web.xml file, I have: login-config auth-methodFORM/auth-method form-login-config form-login-page/signin/logon.jsp/form-login-page form-error-page/signin/logon.jsp?error=true/form-error-page /form-login-config /login-config The Tomcat server found the signinForm.jsp through the /signin/logon.jsp without problem. and my signinForm.jsp is correctly prepared: %@ taglib uri=/tags/struts-html prefix=html % HTML HEAD TITLEContainer Managed Authentication/TITLE /HEAD BODY html:errors/ html:form action=j_security_check method=post focus=j_username TABLE border=0 width=100% TR TH align=rightUser Name:/TH TD align=lefthtml:text property=j_username size=25//TD /TR TR TH align=rightPassword:/TH TD align=lefthtml:password property=j_password size=10//TD /TR TR TD align=righthtml:submit//TD TD align=lefthtml:reset//TD /TR /TABLE /html:form /BODY /HTML --Caroline --- Sasha Borodin [EMAIL PROTECTED] wrote: I think you may be doing two things wrong: 1. j_security_check is a special URL. If you have a security realm defined in your web application, and authentication method specified as FORM, then the container will automatically forward any requests for protected resources to a configurable login form. This login form collects the username and password, and posts to this special URL; the post to j_security_check gets intercepted by your servlet container, which performs Container Managed Authentication - it looks for the j_username and j_password, authenticates the combination, and forwards to the originally requested resource, or to a configurable error page if the authentication fails. All this to say that you can not map an action to j_security_check. Furthermore, you can't even aggressively authenticate using CMA (Container Managed Authentication) - if you go directly to your login page (without being forwarded there by you container), and try to submit the form, you'll get an error. 2. If you were trying to map a legitimate URL, then you'd have your action properties wrong. action path=/someLegitimatePath type=your.action.class name=name of a previously defined ActionForm if needed for this action /action HTH, -Sasha On 10/10/03 20:21, Caroline Jen [EMAIL PROTECTED] wrote: Because there is such a statement (shown below) in my signinForm.jsp: html:form action=j_security_check method=post focus=j_username I put action name=j_security_check path=/do/admin/Menu/ in my struts-config.xml file. When I ran the application, I got: [ServletException in:/article/content/signinForm.jsp] Cannot retrieve mapping for action /j_security_check' I know that I did not specify the action properly. What is the correct way to do it? __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HashMap with options
Manav wrote: Can i use HashMap with options? something like: bean:define id=statusFilters property=statusFilters type=java.util.HashMap / html:options collection=statusFilters property=key labelProperty=value/ Manav, Yes, you should be able to use any Map as the collection, with the attributes you have defined above for html:options.../. However, your bean:define.../ needs a name attribute if you're going to use the property attribute. -- Michael D. Norman ProbuSoft - Custom Software Development http://www.probusoft.com/ 913-390-6951 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How To Work Out This Action Mapping?
Caroline Jen wrote: Thank you for your reply. I am using container managed authentication. My problem is how to go from j_security_check back to my Struts framework. That turns out to not be your problem ... that is the container's problem. The key thing to remember is that the user should never access your login page (whatever it's URL is) directly. Instead, form-based login is triggered the first time that an unauthenticated user requests a URL that is protected by a security constraint. What happens next goes like this: (1) Unauthenticated user requests a protected resource (*NOT* the login page!) (2) Container remembers the protected resource that was requested in a private variable. (3) Container displays the login page, which must have a destination of j_security_check, and waits for the user submit. For some containers, including Tomcat, this is the one-and-only time that submitting to j_security_check will not return a 404. (4) User enters username and password, and presses the submit button. (5) Container authenticates the username and password combination. If valid, container recalls the resource saved in (2) and displays *that* to the user in response to the login submit. If this doesn't make sense, temporarily switch your app to use BASIC authentication instead, and walk through the process. The user experience will be identical except that the login page will be a popup dialog box instead of your configured login page. (Technically, it's different in one other respect -- it's the *browser* that does the remembering in step (2) and the restoring in step (5), but the user doesn't know that). The important point is that, at no time, did anyone ever submit a request to the URL of the login page, because there is no such thing when using BASIC authentication. You should pretend there is no such thing when using form based login, also; think of the login page as part of the container, not part of your app. In answer to your original question, the simplest thing to do on a login page is just use the standard HTML form element instead of the Struts html:form tag. Then, you can just say: form method=POST action=j_security_check ... /form Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]