Re: automatic periodic execution of code
I think Quartz has been the general consensus most times this has been debated on the list. Sng Wee Jim wrote: Hi, What would be the recommended way to execute some code periodically on tomcat/appserver? Should I 1. start a thread (not recommended in appserver and tomcat?) and do it in the run method 2. use third party tool like Quartz 3. or is there existing struts plugin to do it? - Jim The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, please notify the sender of this email immediately. You should not copy, use or disseminate the information contained in the email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Capco. http://www.capco.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
url rewriting problem
(i don't think this made it through the first time i sent it, so i'm trying again. apologies if you get this twice.) i'm getting some weird problems with url rewriting in a struts 1.2.4 webapp. specifically, the urls generated by the form, link, and rewrite tags have an extra "/" prepended to them. struts is mapped like so in web.xml: action /console/* here are examples of what's happening: source: output: //chandler.css source: output: source: output: i don't have any modules configured in struts-xml. here's the mapping for the page that generates the above output: and here's the mapping for the action pointed to by the form: i've attached the full web.xml and struts-config.xml, in case something non-obvious is throwing me off. thanks! http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4"> Chandler Sharing Server javax.servlet.jsp.jstl.fmt.localizationContext MessageResources webdavlog org.apache.slide.webdav.filter.LogFilter logFormat %T, %t, %P, %m, %s "%l", %i, %p outputToConsole false outputToServletLog true webdavlog webdav webdav org.apache.slide.webdav.WebdavServlet domain /WEB-INF/Domain.xml namespace chandler scope depth-limit 3 default-mime-type application/octet-stream default-servlet false directory-browsing true directory-browsing-hide-acl true directory-browsing-hide-locks true optimizePropfindOutput true debug 0 extendedAllprop false lockdiscoveryIncludesPrincipalURL false updateLastModified true 1 root root user user action org.apache.struts.action.ActionServlet config /WEB-INF/struts-config.xml convertNull true 1 webdav /share/* action /console/* html /WEB-INF/tld/struts-html-el.tld logic /WEB-INF/tld/struts-logic-el.tld tiles /WEB-INF/tld/struts-tiles-el.tld c /WEB-INF/tld/c.tld fmt /WEB-INF/tld/fmt.tld fn /WEB-INF/tld/fn.tld java.lang.Throwable /error shared files /share/* COPY DELETE GET HEAD LOCK MKCOL MOVE OPTIONS POST PROPFIND PROPPATCH PUT UNLOCK VERSION-CONTROL REPORT CHECKIN CHECKOUT UNCHECKOUT MKWORKSPACE UPDATE LABEL MERGE BASELINE-CONTROL MKACTIVITY ACL SEARCH BIND UNBIND REBIND SUBSCRIBE UNSUBSCRIBE POLL NOTIFY root user admin console /console/* root user BASIC Chandler Server root user http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
automatic periodic execution of code
Hi, What would be the recommended way to execute some code periodically on tomcat/appserver? Should I 1. start a thread (not recommended in appserver and tomcat?) and do it in the run method 2. use third party tool like Quartz 3. or is there existing struts plugin to do it? - Jim The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, please notify the sender of this email immediately. You should not copy, use or disseminate the information contained in the email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Capco. http://www.capco.com/
Re: javascript validation in struts
Hi, Please visit http://www.roseindia.net/struts/struts_validator_framework.shtml Regards Deepak kumar Jonathan M Z <[EMAIL PROTECTED]> wrote: Hi folks, I am trying to understand struts validation from some example code, it has something like this: action="signin" method="post"> validateSigninForm is a javascript validation. I looked up in validation.xml and validator-rules, neither this javascript function nor anything contain the word "signin" is to be found, so how does struts do its magic clientside validation? (the jsp itself obviously does not have this javasription function either. thanks! __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
RE: Constants for property names - am I barking up an insignificant tree?
Am I alone in finding this issue significant, or was it my tone 8-) Anyone got anything to add? Anything at all? TIA -Miles > -Original Message- > From: Daffin, Miles (Company IT) > Sent: 11 February 2005 17:29 > To: Struts Users Mailing List > Subject: RE: Constants for property names > > My responses are interspersed. > > > Daffin, Miles (Company IT) wrote: > > > What do people feel about using constants for property names? > > > > I can't really see the point. A property name is like a > variable name, > > it will never be displayed or localized, so why would you > ever want to > > change it? > > e.g. Refactor --> rename. (Do you always get it right first > time?) e.g. Misspelling a property name. How would you tell > you had until you get a run time error of some kind? (String > literal constants are evil.) > > > > > > > > Can you think of a case where this value won't be "applicantName"? > > I think you have missed my point, such as it was. The > property name here is defined by the bean. To ensure I don't > misspell it I can use a constant. This makes it easier to > maintain the property: rename or remove. > > > > - jstl tags > > > - xml files (e.g. struts-config, validation) > > > > Worse: if you have an ActionForm, you can't have a property > whose name > > depends on a constant!! And what about getters and setters. > > What do you mean by 'depends on a constant'? ActionForms have > properties. These have names. These names are used in many > places: java, jsp, xml. > > > > Should I forget about defining > > > constants? > > > > Yes :) > > I am unconvinced. > > -Miles > > > NOTICE: If received in error, please destroy and notify > sender. Sender does not waive confidentiality or privilege, > and use is prohibited. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: javascript validation in struts
Hi Jonathan. A quick "dissection" of the code you posted might clarify some of your doubts.. onsubmit="return validateSigninForm(this)" * This piece of code calls a dynamically generated JavaScript function that's created when the page is rendered (for this to happen you have to include within the JSP containing the form.) As you can see, the function name is composed of three parts: "validate", which is a default value, + "Signin", which is the name of your form and the name specified in the tag, + "Form", which is another default value. action="signin" * This is just the Action name that's defined in struts-config.xml for this JSP an its associated Form bean. method="post"> * You also know what this is :^) The validating JavaScript functions containing the different kinds of validation for a given form are generated within the JSP code (although you can override this default behavior. See http://struts.apache.org/userGuide/struts-html.html#javascript). You should check the examples included in the Struts distribution to verify this (view source of JSP's after the browser renders'em). On every submit the JavaScript validation routines are called for every field participating in the validation process. Hope it helps... Regards, Carlos - Original Message - From: "Jonathan M Z" <[EMAIL PROTECTED]> To: Sent: Tuesday, February 15, 2005 5:55 PM Subject: javascript validation in struts Hi folks, I am trying to understand struts validation from some example code, it has something like this: validateSigninForm is a javascript validation. I looked up in validation.xml and validator-rules, neither this javascript function nor anything contain the word "signin" is to be found, so how does struts do its magic clientside validation? (the jsp itself obviously does not have this javasription function either. thanks! __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.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: issue
Wrap it in a tag -Original Message- From: Eric Lemle [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 6:13 PM To: user@struts.apache.org Subject: Fwd: issue Eric D. Lemle Senior Programmer / Analyst Intermountain Health Care 36 South State Street, Suite 1100 Salt Lake City, Utah 84111 United States of America (USA) (801) 442-3688 -- e-mail: [EMAIL PROTECTED] >>> Eric Lemle 2/15/2005 5:10:00 PM >>> STRUTS project. OK I have some normal text that was originally retrieved from a but '' is showing up now. How do I get the page to (show) execute newlines. To make it more confusing I never actually have a page because this runs thru a complex PDF filter. So don't ask me to view the source. Hope this made sense. -Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Fwd: issue
Eric D. Lemle Senior Programmer / Analyst Intermountain Health Care 36 South State Street, Suite 1100 Salt Lake City, Utah 84111 United States of America (USA) (801) 442-3688 -- e-mail: [EMAIL PROTECTED] >>> Eric Lemle 2/15/2005 5:10:00 PM >>> STRUTS project. OK I have some normal text that was originally retrieved from a but '' is showing up now. How do I get the page to (show) execute newlines. To make it more confusing I never actually have a page because this runs thru a complex PDF filter. So don't ask me to view the source. Hope this made sense. -Eric Eric D. Lemle Senior Programmer / Analyst Intermountain Health Care 36 South State Street, Suite 1100 Salt Lake City, Utah 84111 United States of America (USA) (801) 442-3688 -- e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
javascript validation in struts
Hi folks, I am trying to understand struts validation from some example code, it has something like this: validateSigninForm is a javascript validation. I looked up in validation.xml and validator-rules, neither this javascript function nor anything contain the word "signin" is to be found, so how does struts do its magic clientside validation? (the jsp itself obviously does not have this javasription function either. thanks! __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form bean exception -RESOLVED
I made a mistake in the Action mapping. thank you all --- Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > Do you have the action mapping defined for logon.do > in your struts-config > file? what's it like? > > > BTW, just a friendly reminder, you probably don't > want to use that email > id in this list, the audience are global. I happen > to catch it and know > what it means :-( > > thanks, > Saul > > > > > hi folks, > > I have a simple form in struts: > > > > > > > > I get an exception when the jsp page is rendered > > [Servlet Error]-[/Login.jsp]: > > javax.servlet.jsp.JspException: Cannot retrieve > > definition for form bean null > > what's wrong? > > thanks > > > > > > > > __ > > Do you Yahoo!? > > The all-new My Yahoo! - What will yours do? > > http://my.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!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: formbean with List field
From: "Hamster" <[EMAIL PROTECTED]> > I'm wondering if I can have a formbean containing a List of Strings. Is > that recognized by Struts correctly? I have had more luck with String[] than ArrayList. > I need that for a shopping cart implementation, where the user can > modify the amount of the articles in the shopping cart. For each article > should be a text field for entering a number. So I think I need here a > List of Strings in the form bean, right? > > How does the implementaion look like in the form bean? This sounds like a set of indexed properties-- you'd need to keep the quantity 'lined up' with the item number, and you can't depend on the order of the parameters in the request. (In practice, they arrive in the order shown on the HTML form, but that's not guaranteed.) If not indexed properties, then nested beans in the form. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: formbean with List field
In the jsp you can iterate your list and give unique identifier to each one maybe via the index. In the form bean you would have each of the unique names available. May want to use the LazyDynaBean. -Eric Eric D. Lemle Senior Programmer / Analyst Intermountain Health Care 36 South State Street, Suite 1100 Salt Lake City, Utah 84111 United States of America (USA) (801) 442-3688 -- e-mail: [EMAIL PROTECTED] >>> [EMAIL PROTECTED] 2/15/2005 3:13:04 PM >>> Hello struts users! I still have this issue... can anyone help me with this? -- I'm wondering if I can have a formbean containing a List of Strings. Is that recognized by Struts correctly? I need that for a shopping cart implementation, where the user can modify the amount of the articles in the shopping cart. For each article should be a text field for entering a number. So I think I need here a List of Strings in the form bean, right? How does the implementaion look like in the form bean? - 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: bean:include
Well, what I need is the results of complete actions, the final HTML and I want to include a few of those in a report page. So tiles is not really the solution because you only get one action again. -Eric Eric D. Lemle Senior Programmer / Analyst Intermountain Health Care 36 South State Street, Suite 1100 Salt Lake City, Utah 84111 United States of America (USA) (801) 442-3688 -- e-mail: [EMAIL PROTECTED] >>> [EMAIL PROTECTED] 2/15/2005 12:34:59 PM >>> From: "wo shi ni baba" <[EMAIL PROTECTED]> > so essentially there's no replacement of jsp:include > in struts, right? I suppose you could use Tiles to do the same thing as a jsp:include, but if all you need is a simple include, Tiles is overkill. -- Wendy Smoak - 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]
AW: formbean with List field
Hello struts users! I still have this issue... can anyone help me with this? -- I'm wondering if I can have a formbean containing a List of Strings. Is that recognized by Struts correctly? I need that for a shopping cart implementation, where the user can modify the amount of the articles in the shopping cart. For each article should be a text field for entering a number. So I think I need here a List of Strings in the form bean, right? How does the implementaion look like in the form bean? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Proper n tiered exception handling -- RESOLVED -- I think.
Many thanks to everyone who responded, all very helpfull. The approach I've taken looks like this. I still think I've got an issue with nested exceptions. But this is a good start. Data Conn Class Snippet --- try{ //make the conn here }catch(NamingException zNamingEx){ Logger.logMessage("EXCEPTION::DBConnection::getConnection::Naming Exception--" +zNamingEx); throw new Exception( zNamingEx.toString(), zNamingEx); --- Data Class that catches the conn error. --- try { zConnection_m = zDBConnection_m.getConnection(); }catch(Exception zAppEx){ Logger.logMessage("EXCEPTION::MyClass.getRepByID::Couldn't Get DB Connection--" +zAppEx); throw zAppEx; } --- Application Exception --- public class ApplicationException extends ExceptionHandler { public ActionForward execute( Exception ex, ExceptionConfig ae, ActionMapping mapping, ActionForm formInstance, HttpServletRequest request, HttpServletResponse response) throws ServletException { request.setAttribute("ApplicationException", ex); return new ActionForward(ae.getPath()); } } --- struts-config --- --- error.jsp --- Thanks -Original Message- From: Brian McGovern [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 3:12 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Proper n tiered exception handling This worked for me for the most part. I now have a global exception and am able to get the last trace within your comment tags. But in my data class I'm closing my db connections and result sets in try catch blocks, so in this case, the user would see the global error page in the following case if a connection could not be closed for some reason which I know would be very rare, but still: if (zDBConnection_m != null) { try { zDBConnection_m.closeConnection(); Logger.logDebug("Closed DB Connection in MyData.getRepByID "); } catch (Exception zCONNEx) {Logger.logMessage("EXCEPTION::MyData.getRepByID::Couldn't close CONN--" +zCONNEx);} } This is not a fatal error and I don't want the user to see this. So my follow up question is can I model a single exception to be thrown in my critical catch blocks throughout all tiers of my app that can extend off a struts framework class that shows the error to the user though a jsp page defined in struts-config.xml Im pretty sure im reading that you can, but am having trouble understanding the theory. I'd LOVE an example of an ApplicationSpecificException class. Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 12:00 PM To: Struts Users Mailing List Subject: RE: Proper n tiered exception handling I'm sure your right Dan. That code is pretty old now and I would do it differently today. But at the time given my understanding, this is what I came up with. Actually couldn't tell you why I did it that way :) The thing to focus on here in the example is the use of HTML comments to "embed" the actually problem. Good stuff though, thanks -Original Message- From: Daniel Lipofsky <[EMAIL PROTECTED]> Sent: Feb 15, 2005 11:52 AM To: Struts Users Mailing List Subject: RE: Proper n tiered exception handling Why do you do all that work to print the stack trace? Shouldn't exception.printStackTrace(out) do what you want? This also follows the exception.getCause() chain and prints out nested exceptions. As a side note, if you really want to log all nested exceptions then you have to do a little extra work because some exceptions implement nesting in a way that is not returned by getCause() (mostly because it is an old implementation). I do the following: log.error(exception.getMessage(), exception); // struts utils often save original exception under Globals.EXCEPTION_KEY Throwable t = (Throwable) pageContext. getAttribute(Globals.EXCEPTION_KEY, PageContext.REQUEST_SCOPE); if (t != null && t != exception && t != exception.getCause()) { log.error("original exception: ", t); } if (exception instanceof JspException) { Throwable t2 = ((JspException)exception).getRootCause(); if (t2 != null && t2 != t && t2 != exception && t2 != exception.getCause()) log.error("root cause: ", t2); } else if (exception instanceof EJBException) { Throwable t3 = ((EJBException)exception).getCausedByException(); if (t3 != null && t3 != t && t3 != exception && t3 != exception.getCause()) log.er
RE: [SPAM] - Re: Caching Appliction Level Data? (session listener) - Email has different SMTP TO: and MIME TO: fields in the email addresses
Thanks it works now . We are using 2.3. -Original Message- From: Craig McClanahan [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 3:58 PM To: Manuchehar Khan Cc: Struts Users Mailing List Subject: Re: [SPAM] - Re: Caching Appliction Level Data? (session listener) - Email has different SMTP TO: and MIME TO: fields in the email addresses On Tue, 15 Feb 2005 15:53:15 -0500, Manuchehar Khan <[EMAIL PROTECTED]> wrote: > 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";> This is the problem ... the element was added in Servlet 2.3, so you need to use the 2.3 version of the DTD: http://java.sun.com/dtd/web-app_2_3.dtd";> Of course, you'll need a 2.3 container to run in as well. If you only have 2.2, then use a Struts PlugIn instead of ServletContextListener. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [SPAM] - Re: Caching Appliction Level Data? (session listener) - Email has different SMTP TO: and MIME TO: fields in the email addresses
On Tue, 15 Feb 2005 15:53:15 -0500, Manuchehar Khan <[EMAIL PROTECTED]> wrote: > 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";> This is the problem ... the element was added in Servlet 2.3, so you need to use the 2.3 version of the DTD: http://java.sun.com/dtd/web-app_2_3.dtd";> Of course, you'll need a 2.3 container to run in as well. If you only have 2.2, then use a Struts PlugIn instead of ServletContextListener. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [SPAM] - Re: Caching Appliction Level Data? (session listener) - Email has different SMTP TO: and MIME TO: fields in the email addresses
I am using HttpSessionListener and works fine. But problem is when I compile my project I have to remove it from web.xml as compilation fails. I am using JDeveloper . This is first entry in my web.xml file. http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";> OLDCSessionListener OLDCSessionAttributeListener Any help will be appreciated. Thanks -Original Message- From: Craig McClanahan [mailto:[EMAIL PROTECTED] Sent: Monday, February 14, 2005 4:43 PM To: Leon Rosenberg Cc: Struts Users Mailing List Subject: [SPAM] - Re: Caching Appliction Level Data? (session listener) - Email has different SMTP TO: and MIME TO: fields in the email addresses HttpSessionBindingListener only works on an attribute itself (so you can tell when you get added or removd) -- it's been around since Servlet 2.0. I was referring to HttpSessionListener (tells you about session creations and deletions) and HttpSessionAttributeListener (tells you about attribute add/remove/replace events). Craig On Mon, 14 Feb 2005 22:29:07 +0100, Leon Rosenberg <[EMAIL PROTECTED]> wrote: > > > > * There are also other listeners that you should > > explore which are available in this version -- did > > you know, for example, that you can be notified > > whenever anyone else in your app adds, removes, > > or replaces an application or session scope attribute? > > (In Servlet 2.4 you can do this for request scope too.) > > You mean something like: > > > ...presentation.util.SessionObjectPrintln > > > > public class SessionObjectPrintln implements HttpSessionBindingListener{ > > public void valueBound(HttpSessionBindingEvent e) { > System.out.println("Value bound:"+e.getName()+", > "+e.getSource()); > > } > > public void valueUnbound(HttpSessionBindingEvent e) { > System.out.println("Value unbound:"+e.getName()+", > "+e.getSource()); > > } > } > > Tried it with resin 3.0.8 and tomcat 5.0.25,28, neither worked :-( > > - 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: form bean exception
From: "Jonathan M Z" <[EMAIL PROTECTED]> > I have a simple form in struts: > > > > I get an exception when the jsp page is rendered > [Servlet Error]-[/Login.jsp]: > javax.servlet.jsp.JspException: Cannot retrieve > definition for form bean null > what's wrong? Try it without the ".do": If that doesn't work, post the relevant part of struts-config.xml. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form bean exception
Do you have the action mapping defined for logon.do in your struts-config file? what's it like? BTW, just a friendly reminder, you probably don't want to use that email id in this list, the audience are global. I happen to catch it and know what it means :-( thanks, Saul > hi folks, > I have a simple form in struts: > > > > I get an exception when the jsp page is rendered > [Servlet Error]-[/Login.jsp]: > javax.servlet.jsp.JspException: Cannot retrieve > definition for form bean null > what's wrong? > thanks > > > > __ > Do you Yahoo!? > The all-new My Yahoo! - What will yours do? > http://my.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: Construting HTML Email from Struts
Ok got it! >> do you mean creating custom tags? That's what I meant. I mean you don't need recursive degression in order parse a file like this. ;-) GreetZ Nils -Original Message- From: Todd Nine [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 4:26 PM To: Struts Users Mailing List Subject: Re: Construting HTML Email from Struts Nils, When you say special tags, do you mean creating custom tags? The reason I want to have this dynamic environment is so that we can upload content without the need to deploy another ear. This way when the business people change the content of the email, we can easily upload a new format and send out the email. On Tue, 15 Feb 2005 15:31:38 +0200, Nils Liebelt <[EMAIL PROTECTED]> wrote: > Sounds a bit complicated! Why do you need > to have struts tags? I would go for plain html and add > special tags for whatever you need. > Path of least resistence... > > GreetZ > > Nils > > -Original Message- > From: Todd Nine [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 15, 2005 2:50 PM > To: Struts Users Mailing List > Subject: Construting HTML Email from Struts > > Hi all, >Does anyone know of a way to construct an HTML formatted email > using a struts jsp and a DynaForm? I want our visual designers to be > able to updload an email "template", which is just a Struts jsp with > the dynabean properties. We would then upload a mapping (something > like hql in nature), that would query our database, and fill in the > dynabean. The batch job would fire and create the html from the > struts jsp, inserting into the body. We would then email that text. > > Any Ideas? > Todd > > - > 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: Construting HTML Email from Struts
Ok got it! >> do you mean creating custom tags? That's what I meant. I mean you don't need recursive degression in order parse a file like this. ;-) GreetZ Nils -Original Message- From: Todd Nine [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 4:26 PM To: Struts Users Mailing List Subject: Re: Construting HTML Email from Struts Nils, When you say special tags, do you mean creating custom tags? The reason I want to have this dynamic environment is so that we can upload content without the need to deploy another ear. This way when the business people change the content of the email, we can easily upload a new format and send out the email. On Tue, 15 Feb 2005 15:31:38 +0200, Nils Liebelt <[EMAIL PROTECTED]> wrote: > Sounds a bit complicated! Why do you need > to have struts tags? I would go for plain html and add > special tags for whatever you need. > Path of least resistence... > > GreetZ > > Nils > > -Original Message- > From: Todd Nine [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 15, 2005 2:50 PM > To: Struts Users Mailing List > Subject: Construting HTML Email from Struts > > Hi all, >Does anyone know of a way to construct an HTML formatted email > using a struts jsp and a DynaForm? I want our visual designers to be > able to updload an email "template", which is just a Struts jsp with > the dynabean properties. We would then upload a mapping (something > like hql in nature), that would query our database, and fill in the > dynabean. The batch job would fire and create the html from the > struts jsp, inserting into the body. We would then email that text. > > Any Ideas? > Todd > > - > 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: Proper n tiered exception handling
This worked for me for the most part. I now have a global exception and am able to get the last trace within your comment tags. But in my data class I'm closing my db connections and result sets in try catch blocks, so in this case, the user would see the global error page in the following case if a connection could not be closed for some reason which I know would be very rare, but still: if (zDBConnection_m != null) { try { zDBConnection_m.closeConnection(); Logger.logDebug("Closed DB Connection in MyData.getRepByID "); } catch (Exception zCONNEx) {Logger.logMessage("EXCEPTION::MyData.getRepByID::Couldn't close CONN--" +zCONNEx);} } This is not a fatal error and I don't want the user to see this. So my follow up question is can I model a single exception to be thrown in my critical catch blocks throughout all tiers of my app that can extend off a struts framework class that shows the error to the user though a jsp page defined in struts-config.xml Im pretty sure im reading that you can, but am having trouble understanding the theory. I'd LOVE an example of an ApplicationSpecificException class. Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 12:00 PM To: Struts Users Mailing List Subject: RE: Proper n tiered exception handling I'm sure your right Dan. That code is pretty old now and I would do it differently today. But at the time given my understanding, this is what I came up with. Actually couldn't tell you why I did it that way :) The thing to focus on here in the example is the use of HTML comments to "embed" the actually problem. Good stuff though, thanks -Original Message- From: Daniel Lipofsky <[EMAIL PROTECTED]> Sent: Feb 15, 2005 11:52 AM To: Struts Users Mailing List Subject: RE: Proper n tiered exception handling Why do you do all that work to print the stack trace? Shouldn't exception.printStackTrace(out) do what you want? This also follows the exception.getCause() chain and prints out nested exceptions. As a side note, if you really want to log all nested exceptions then you have to do a little extra work because some exceptions implement nesting in a way that is not returned by getCause() (mostly because it is an old implementation). I do the following: log.error(exception.getMessage(), exception); // struts utils often save original exception under Globals.EXCEPTION_KEY Throwable t = (Throwable) pageContext. getAttribute(Globals.EXCEPTION_KEY, PageContext.REQUEST_SCOPE); if (t != null && t != exception && t != exception.getCause()) { log.error("original exception: ", t); } if (exception instanceof JspException) { Throwable t2 = ((JspException)exception).getRootCause(); if (t2 != null && t2 != t && t2 != exception && t2 != exception.getCause()) log.error("root cause: ", t2); } else if (exception instanceof EJBException) { Throwable t3 = ((EJBException)exception).getCausedByException(); if (t3 != null && t3 != t && t3 != exception && t3 != exception.getCause()) log.error("caused by: ", t3); } - Dan > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 15, 2005 8:35 AM > To: Struts Users Mailing List > Subject: RE: Proper n tiered exception handling > > I probably have not shown you enough in terms of setup. > There is more to configure this completely. I will try to > outline this shortly. To answer your question , I don't > rethrow anything. It's not necessary. Your struts actions > have the following signature: > > public ActionForward execute(ActionMapping mapping, > ActionForm form, > HttpServletRequest req, HttpServletResponse resp) > throws Exception > { >... > } > > Any exception thrown within this method with propagate up > through the exception handling framework. Whether it's a > SQLException, RemoteException or any checked or runtime > exception will flow upward. You delcare where to forward to > (what page). I designed a generic error handling jsp, > because I did not want to design a separate JSP for every > type of exception. This is a preference thing. My way was > right for me. Here is my JSP for handling errors: > > <[EMAIL PROTECTED] import="java.util.*" %> > <[EMAIL PROTECTED] uri="/WEB-INF/taglibs-log.tld" prefix="log" %> > <[EMAIL PROTECTED] uri="/WEB-INF/fmt.tld" prefix="fmt" %> > <[EMAIL PROTECTED] uri="/WEB-INF/c.tld" prefix="c" %> > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> > > <% > Throwable t = > (Throwable)request.getAttribute("org.apache.struts.action.EXCEPTION"); > if ( t!= null) > { > StackTraceElement [] trace = t.getStackTrace(); >
Re: Name of JSP in Request
On Tue, 15 Feb 2005 14:53:40 -0500, Matt Hughes <[EMAIL PROTECTED]> wrote: > When I am inside a JSP page, is there any way to access the forward path > in the action mapping: > > type="com.xyz.actions.admin.COLDCacheAction" > scope="request"> > path="/pages/admin/COLDCache.jsp"/> > > > In other words, does Struts, when it forwards control to the JSP page, > put a variable in the request scope like > request.setAttribute("path","/pages/admin/COLDCache.jsp"); > Struts does not do this for you, but your servlet container will set the characteristics of the HttpServletRequest object to reflect the paths of the JSP page. Thus, in a JSP, <%= request.getServletPath() %> should return you the name of the JSP, not the action to which the form was submitted. Craig > > - > 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]
form bean exception
hi folks, I have a simple form in struts: I get an exception when the jsp page is rendered [Servlet Error]-[/Login.jsp]: javax.servlet.jsp.JspException: Cannot retrieve definition for form bean null what's wrong? thanks __ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Name of JSP in Request
When I am inside a JSP page, is there any way to access the forward path in the action mapping: In other words, does Struts, when it forwards control to the JSP page, put a variable in the request scope like request.setAttribute("path","/pages/admin/COLDCache.jsp"); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Caching Appliction Level Data?
Caching or not is also a decision that you sometimes want to change after you see your application used in anger for a while. I like to provide a getter method on some application scoped bean that returns things like this, so I can change my decision to implement caching (or not), for any given set of data, without impacting the rest of the application -- it just calls the getter whenever it wants that data. Craig On Tue, 15 Feb 2005 13:58:32 -0500, Soaring Eagle <[EMAIL PROTECTED]> wrote: > Without contesting the good points. I would say memory is cheap. For > an application i worked on, we had about 6 different applications > sitting on two 4 by 16 machines. The -xmx arguments of all apps put > together came up to about 10 gigs RAM and the rest was left open. i > dont think serious application owners care about money sunk on > hardware. > > Further, I agree that caching requires an overhead in terms of keeping > various clusters in synch or managing updates etc.. but clients can be > kept transparent of all this. there may be a period of a few 100 > milliseconds to upto a couple of seconds when clients may get dirty > reads if the cache design allows it - but that could be a small price > to pay over the general speed of cache access. > > Anyways - sorry for contributing to making this a totally non-struts topic! > > > On Tue, 15 Feb 2005 11:03:01 -0500, Bill Schneider <[EMAIL PROTECTED]> wrote: > > >> how do you manage cross container caches if you are clustered - when > > >> you are using static members on classes? How do guarantee sameness on > > >> different physical machines? We do have a few caches in our > > >> application and are facing issues due to this design or an improperly > > >> implemented version of this design. > > > > Also, be aware that caching can actually degrade application performance > > in some cases. Everything you cache takes space in the JVM heap, > > reducing what's left to process active requests. So it's possible to > > lose more cycles in GC than you saved by caching in the first place. You > > can just keep increasing -Xmx, but that can hurt you if the JVM starts > > using swap space/virtual memory for the Java heap. > > > > If you're using a clustered cache, you also have the overhead of keeping > > the caches on each JVM in sync. That adds network as well as processing > > overhead for marshalling and unmarshalling cached objects. > > > > In summary, J2EE webapp performance involves a lot of tradeoffs. Caching > > is important but has to be used judiciously to be beneficial. > > > > -- Bill > > -- > > Bill Schneider > > Chief Architect > > > > Vecna Technologies > > 5004 Lehigh Rd., Suite B > > College Park, MD 20740 > > [EMAIL PROTECTED] > > t: 301-864-7253 x1140 > > f: 301-699-3180 > > > > > > - > > 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: bean:include
From: "wo shi ni baba" <[EMAIL PROTECTED]> > so essentially there's no replacement of jsp:include > in struts, right? I suppose you could use Tiles to do the same thing as a jsp:include, but if all you need is a simple include, Tiles is overkill. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Caching Appliction Level Data?
Without contesting the good points. I would say memory is cheap. For an application i worked on, we had about 6 different applications sitting on two 4 by 16 machines. The -xmx arguments of all apps put together came up to about 10 gigs RAM and the rest was left open. i dont think serious application owners care about money sunk on hardware. Further, I agree that caching requires an overhead in terms of keeping various clusters in synch or managing updates etc.. but clients can be kept transparent of all this. there may be a period of a few 100 milliseconds to upto a couple of seconds when clients may get dirty reads if the cache design allows it - but that could be a small price to pay over the general speed of cache access. Anyways - sorry for contributing to making this a totally non-struts topic! On Tue, 15 Feb 2005 11:03:01 -0500, Bill Schneider <[EMAIL PROTECTED]> wrote: > >> how do you manage cross container caches if you are clustered - when > >> you are using static members on classes? How do guarantee sameness on > >> different physical machines? We do have a few caches in our > >> application and are facing issues due to this design or an improperly > >> implemented version of this design. > > Also, be aware that caching can actually degrade application performance > in some cases. Everything you cache takes space in the JVM heap, > reducing what's left to process active requests. So it's possible to > lose more cycles in GC than you saved by caching in the first place. You > can just keep increasing -Xmx, but that can hurt you if the JVM starts > using swap space/virtual memory for the Java heap. > > If you're using a clustered cache, you also have the overhead of keeping > the caches on each JVM in sync. That adds network as well as processing > overhead for marshalling and unmarshalling cached objects. > > In summary, J2EE webapp performance involves a lot of tradeoffs. Caching > is important but has to be used judiciously to be beneficial. > > -- Bill > -- > Bill Schneider > Chief Architect > > Vecna Technologies > 5004 Lehigh Rd., Suite B > College Park, MD 20740 > [EMAIL PROTECTED] > t: 301-864-7253 x1140 > f: 301-699-3180 > > > - > 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: Construting HTML Email from Struts
Its just the name of the scripting variable that you use in the where the body of whats enclosed in the will be written to (in this case the genrated email). Niall - Original Message - From: "Shey Rab Pawo" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, February 15, 2005 3:29 PM Subject: Re: Construting HTML Email from Struts > Niall, > > What is the origin of the "emailStuff" in this wiki page? Thanks. > > > On Tue, 15 Feb 2005 14:25:29 -, Niall Pemberton > <[EMAIL PROTECTED]> wrote: > > I posted this for someone who asked a similar quesiton recently. > > > > http://www.niallp.pwp.blueyonder.co.uk/emailTemplate.html > > > > Niall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem validating form
I am fairly new to Struts and using the 1.1 version. I have a form bean that didn't have a validate method and just tried adding it (validate()) and now getting errors which I guess I kind-of understand but need to know how people generally work around this issue. The page has fields for title, author and some dropdowns for product and release. The page populates the product and release dropdowns from maps that I stuff in the request (request.setAttribute()). I added code in the validate to ensure that a title and author have been entered. Problem is: if you don't enter those, then my action never gets called to populate those items (product & release) in the request. Which later results in a jsp page error because it can't find the 'bean' for product (or release). Is this a problem that is generally 'caught' in the jsp page by checking for the bean or is there something that I need to do in the code? Is this where the reset() method might be used to provide a 'default' value? Mike Miller JDA Software Group, Inc. 7501 Ester's Blvd, Suite 100 Irving, Texas 75063
Re: Antwort: Re: Antwort: bean:include
Hi thanks, so essentially there's no replacement of jsp:include in struts, right? --- Karsten Krieg <[EMAIL PROTECTED]> wrote: > > Hi! > > Nothing special here. Let's say you've an struts > action like this: > > name="variableForm" > path="/editVariable" > scope="request" > > type="de.intarsys.efselect.web.action.page.EditVariableAction" > input="/variable.jsp" > validate="true"> >path="/prepMatchFields.do" /> >path="/prepShowValue.do" /> > > > The referenced variable.jsp itself has a java > scriptlet like this: > <% > String typePage = "/variable/detail_" + > container.getType() + ".jsp"; > %> > > In my html-table of individual contents I just : > > > > > > So, Struts is not really involved. > > Regards > Karsten Krieg > intarsys consulting GmbH > > Fon +49 (0)721 3 84 79 - 28 > Fax +49 (0)721 3 84 79 - 60 > e-mail [EMAIL PROTECTED] > http://www.intarsys.de > > "Iran! That's where the weapons of mass destruction > were! It was a typo all > along!" > > wo shi ni baba <[EMAIL PROTECTED]> schrieb > am 15.02.2005 09:31:19: > > > hi, thanks, but would you tell me how to do it in > > struts? > > > > --- Karsten Krieg <[EMAIL PROTECTED]> wrote: > > > > > > > > Hi! > > > > > > Why not just use jsp:include. There's nothing > wrong > > > with it. You can even > > > use a request attribute for setting the jsp > page. > > > > > > > > > > > > Regards > > > Karsten Krieg > > > intarsys consulting GmbH > > > > > > Fon +49 (0)721 3 84 79 - 28 > > > Fax +49 (0)721 3 84 79 - 60 > > > e-mail [EMAIL PROTECTED] > > > http://www.intarsys.de > > > > > > "Iran! That's where the weapons of mass > destruction > > > were! It was a typo all > > > along!" > > > > > > wo shi ni baba <[EMAIL PROTECTED]> > schrieb > > > am 15.02.2005 03:54:38: > > > > > > > Hi folks, > > > > I am new to struts, I am trying to get the > > > equivalent > > > > of jsp:include in struts. I tried > > > > > > > > this itself does not actually print the > content. > > > what > > > > else do I need to do to get Top.jsp onto the > > > screen? > > > > thanks in advance > > > > > > > > > > > > > > > > > > > > __ > > > > Do you Yahoo!? > > > > The all-new My Yahoo! - What will yours do? > > > > http://my.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!? > > All your favorites on one personal page ? Try My > Yahoo! > > http://my.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 all-new My Yahoo! - Get yours free! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with Tomcat 4.1.30 (Linux)
What does the generated HTML source look like? Frank Schaare wrote: Sorry, i wrote that example right out of your mind. is nested inside the that is not my problem. Jeff Beal schrieb: The renders an HTML element. The renders a single element The renders several elements. should not contain , both should be included inside of an tag: ... -- Jeff Frank Schaare wrote: please select ... Now, i deployed my app in Tomcat 4.1.30 (Linux) and all my selects are useless ! All values are rendered in the first option like: please select ...GermanyFranceUSAItaly etc. - 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: Problems with Tomcat 4.1.30 (Linux)
Sorry, i wrote that example right out of your mind. is nested inside the that is not my problem. Jeff Beal schrieb: The renders an HTML element. The renders a single element The renders several elements. should not contain , both should be included inside of an tag: ... -- Jeff Frank Schaare wrote: please select ... Now, i deployed my app in Tomcat 4.1.30 (Linux) and all my selects are useless ! All values are rendered in the first option like: please select ...GermanyFranceUSAItaly etc. - 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: Proper n tiered exception handling
I think you are missing out on some usefull features by using this. You can't use the ActionMapping Parameter property to distinguish operations and you will have to reimplement a solution if you use DispatchAction. I think there are benefits to declaritive exception handling, flexibility. Mark -Original Message- From: Ole Hildebrandt [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 12:21 PM To: 'Struts Users Mailing List' Subject: AW: Proper n tiered exception handling Hi. My personal opinion is, that the Struts Exception handling doesn't bring any benefits. I use an approch based on inheritance and the "Template Method"-Pattern from the GoF: I create an abstract Class extended from "Action". All application-Specific Actions extend that class. The Abstract Action-class is responsible for catching all Exceptions that were not explicitly catched by the extending class. Source-Snippet from the Abstact Class "AbstractContoller.java": public abstract class AbstractController extends Action { //Template-Method. Calls "doExecute" on each Request and handles uncaught Exceptions: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { try { return doExecute(mapping,form, request,response); } catch (Throwable e) { request.setAttribute("messagekey","error.unknownError"); log.error("Uncought Exception",e); return mapping.findForward("error"); } } //All extending classed implement this method public abstract ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception ; And I use ExceptionChaining. See this article for more info: http://www.javaworld.com/javaworld/jw-09-2001/jw-0914-exceptions.html? Kind Regards Ole -Ursprüngliche Nachricht- Von: Brian McGovern [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 15. Februar 2005 16:28 An: user@struts.apache.org Betreff: Proper n tiered exception handling I'm looking to get a handle on best exception handling practices in my app. Kinda beginner question i guess, sorry. Im catching the various sql and naming exceptions in the data classes and logging and throwing a custom exception called ApplicationException which is blank and provided below. I've read up but an still a little confused on how exactly to build this exception class to extend the available struts exception classes that would gracefully map to an error display jsp where i could display the error to the user. Right now I just get the HTTP status 500 strack trace on the screen. Controller snippet that catches the data obj's thrown ApplicationException: try { zRepBeanBn = MyData.getRepByID(StringUtils.convertToInt(request.getParameter("RepID"))); }catch (ApplicationException zAppEx){ throw zAppEx; } ApplicationException that needs work: How do I extend this? public class ApplicationException extends Exception { public ApplicationException(String message) { } } Thanks - 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: Problems with Tomcat 4.1.30 (Linux)
The renders an HTML element. The renders a single element The renders several elements. should not contain , both should be included inside of an tag: ... -- Jeff Frank Schaare wrote: please select ... Now, i deployed my app in Tomcat 4.1.30 (Linux) and all my selects are useless ! All values are rendered in the first option like: please select ...GermanyFranceUSAItaly etc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Proper n tiered exception handling
Hi. My personal opinion is, that the Struts Exception handling doesn't bring any benefits. I use an approch based on inheritance and the "Template Method"-Pattern from the GoF: I create an abstract Class extended from "Action". All application-Specific Actions extend that class. The Abstract Action-class is responsible for catching all Exceptions that were not explicitly catched by the extending class. Source-Snippet from the Abstact Class "AbstractContoller.java": public abstract class AbstractController extends Action { //Template-Method. Calls "doExecute" on each Request and handles uncaught Exceptions: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { try { return doExecute(mapping,form, request,response); } catch (Throwable e) { request.setAttribute("messagekey","error.unknownError"); log.error("Uncought Exception",e); return mapping.findForward("error"); } } //All extending classed implement this method public abstract ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception ; And I use ExceptionChaining. See this article for more info: http://www.javaworld.com/javaworld/jw-09-2001/jw-0914-exceptions.html? Kind Regards Ole -Ursprüngliche Nachricht- Von: Brian McGovern [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 15. Februar 2005 16:28 An: user@struts.apache.org Betreff: Proper n tiered exception handling I'm looking to get a handle on best exception handling practices in my app. Kinda beginner question i guess, sorry. Im catching the various sql and naming exceptions in the data classes and logging and throwing a custom exception called ApplicationException which is blank and provided below. I've read up but an still a little confused on how exactly to build this exception class to extend the available struts exception classes that would gracefully map to an error display jsp where i could display the error to the user. Right now I just get the HTTP status 500 strack trace on the screen. Controller snippet that catches the data obj's thrown ApplicationException: try { zRepBeanBn = MyData.getRepByID(StringUtils.convertToInt(request.getParameter("RepID"))); }catch (ApplicationException zAppEx){ throw zAppEx; } ApplicationException that needs work: How do I extend this? public class ApplicationException extends Exception { public ApplicationException(String message) { } } Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with Tomcat 4.1.30 (Linux)
Hi, IÂve developed my Struts application with Tomcat 4.1.30 (Windows). Everything works fine, i tested my stuff withe different browsers, different Eclipseversions etc. There is a fomularBean whitch holds some prefetched data in key-value maps, some as a vector, some as RowSetDynaBeans, some as hashmaps. This data feeds my selects like the following example: please select ... Now, i deployed my app in Tomcat 4.1.30 (Linux) and all my selects are useless ! All values are rendered in the first option like: please select ...GermanyFranceUSAItaly etc. I have absolutely no idea what the problem is. Tomcat seems to hav some problems with those tags, but they are installed properly an no exception or problem is logged. Has anybody ever faced this behaviour or has some hints where to continue my search ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design pattern for struts.
Struts itself is an example of the Service to Worker Pattern, which is a macro pattern using a combination of a controller and dispatcher with views and helpers. -Original Message- From: Sandip Khetle [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 12:25 AM To: user@struts.apache.org Subject: Design pattern for struts. Hi all Can anyone tell me what all design patterns does the struts framework use.? Does it uses the mediator design pattern? Thanks in advance Regards, Sandip Khetle - 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: Proper n tiered exception handling
I'm sure your right Dan. That code is pretty old now and I would do it differently today. But at the time given my understanding, this is what I came up with. Actually couldn't tell you why I did it that way :) The thing to focus on here in the example is the use of HTML comments to "embed" the actually problem. Good stuff though, thanks -Original Message- From: Daniel Lipofsky <[EMAIL PROTECTED]> Sent: Feb 15, 2005 11:52 AM To: Struts Users Mailing List Subject: RE: Proper n tiered exception handling Why do you do all that work to print the stack trace? Shouldn't exception.printStackTrace(out) do what you want? This also follows the exception.getCause() chain and prints out nested exceptions. As a side note, if you really want to log all nested exceptions then you have to do a little extra work because some exceptions implement nesting in a way that is not returned by getCause() (mostly because it is an old implementation). I do the following: log.error(exception.getMessage(), exception); // struts utils often save original exception under Globals.EXCEPTION_KEY Throwable t = (Throwable) pageContext. getAttribute(Globals.EXCEPTION_KEY, PageContext.REQUEST_SCOPE); if (t != null && t != exception && t != exception.getCause()) { log.error("original exception: ", t); } if (exception instanceof JspException) { Throwable t2 = ((JspException)exception).getRootCause(); if (t2 != null && t2 != t && t2 != exception && t2 != exception.getCause()) log.error("root cause: ", t2); } else if (exception instanceof EJBException) { Throwable t3 = ((EJBException)exception).getCausedByException(); if (t3 != null && t3 != t && t3 != exception && t3 != exception.getCause()) log.error("caused by: ", t3); } - Dan > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 15, 2005 8:35 AM > To: Struts Users Mailing List > Subject: RE: Proper n tiered exception handling > > I probably have not shown you enough in terms of setup. > There is more to configure this completely. I will try to > outline this shortly. To answer your question , I don't > rethrow anything. It's not necessary. Your struts actions > have the following signature: > > public ActionForward execute(ActionMapping mapping, > ActionForm form, > HttpServletRequest req, HttpServletResponse resp) > throws Exception > { >... > } > > Any exception thrown within this method with propagate up > through the exception handling framework. Whether it's a > SQLException, RemoteException or any checked or runtime > exception will flow upward. You delcare where to forward to > (what page). I designed a generic error handling jsp, > because I did not want to design a separate JSP for every > type of exception. This is a preference thing. My way was > right for me. Here is my JSP for handling errors: > > <[EMAIL PROTECTED] import="java.util.*" %> > <[EMAIL PROTECTED] uri="/WEB-INF/taglibs-log.tld" prefix="log" %> > <[EMAIL PROTECTED] uri="/WEB-INF/fmt.tld" prefix="fmt" %> > <[EMAIL PROTECTED] uri="/WEB-INF/c.tld" prefix="c" %> > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> > > <% > Throwable t = > (Throwable)request.getAttribute("org.apache.struts.action.EXCEPTION"); > if ( t!= null) > { > StackTraceElement [] trace = t.getStackTrace(); > int size = trace.length; > out.print(""); > } > > %> > > > > > System Error > > > > > > > > > > >bundle="systemerrorbundle"/> > > > > > > > > > > > > > > > > > There's more to this story. Notice the line: > > > This is where I supply a customer message. The message is > externalized in a properties file for I18N. This is my > syserror.jsp page which is referenced in the struts.xml config. > > > > -Original Message- > From: Brian McGovern <[EMAIL PROTECTED]> > Sent: Feb 15, 2005 11:24 AM > To: Struts Users Mailing List , > [EMAIL PROTECTED] > Subject: RE: Proper n tiered exception handling > > Jim, > So in this approach you really dont use any try catch blocks > at all? or you just re - throw the original exception that you caught? > > How do you grab the error on the JSP page? > > Thanks > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 15, 2005 11:16 AM > To: Struts Users Mailing List > Subject: Re: Proper n tiered exception handling > > > I use
RE: Proper n tiered exception handling
Why do you do all that work to print the stack trace? Shouldn't exception.printStackTrace(out) do what you want? This also follows the exception.getCause() chain and prints out nested exceptions. As a side note, if you really want to log all nested exceptions then you have to do a little extra work because some exceptions implement nesting in a way that is not returned by getCause() (mostly because it is an old implementation). I do the following: log.error(exception.getMessage(), exception); // struts utils often save original exception under Globals.EXCEPTION_KEY Throwable t = (Throwable) pageContext. getAttribute(Globals.EXCEPTION_KEY, PageContext.REQUEST_SCOPE); if (t != null && t != exception && t != exception.getCause()) { log.error("original exception: ", t); } if (exception instanceof JspException) { Throwable t2 = ((JspException)exception).getRootCause(); if (t2 != null && t2 != t && t2 != exception && t2 != exception.getCause()) log.error("root cause: ", t2); } else if (exception instanceof EJBException) { Throwable t3 = ((EJBException)exception).getCausedByException(); if (t3 != null && t3 != t && t3 != exception && t3 != exception.getCause()) log.error("caused by: ", t3); } - Dan > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 15, 2005 8:35 AM > To: Struts Users Mailing List > Subject: RE: Proper n tiered exception handling > > I probably have not shown you enough in terms of setup. > There is more to configure this completely. I will try to > outline this shortly. To answer your question , I don't > rethrow anything. It's not necessary. Your struts actions > have the following signature: > > public ActionForward execute(ActionMapping mapping, > ActionForm form, > HttpServletRequest req, HttpServletResponse resp) > throws Exception > { >... > } > > Any exception thrown within this method with propagate up > through the exception handling framework. Whether it's a > SQLException, RemoteException or any checked or runtime > exception will flow upward. You delcare where to forward to > (what page). I designed a generic error handling jsp, > because I did not want to design a separate JSP for every > type of exception. This is a preference thing. My way was > right for me. Here is my JSP for handling errors: > > <[EMAIL PROTECTED] import="java.util.*" %> > <[EMAIL PROTECTED] uri="/WEB-INF/taglibs-log.tld" prefix="log" %> > <[EMAIL PROTECTED] uri="/WEB-INF/fmt.tld" prefix="fmt" %> > <[EMAIL PROTECTED] uri="/WEB-INF/c.tld" prefix="c" %> > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> > > <% > Throwable t = > (Throwable)request.getAttribute("org.apache.struts.action.EXCEPTION"); > if ( t!= null) > { > StackTraceElement [] trace = t.getStackTrace(); > int size = trace.length; > out.print(""); > } > > %> > > > > > System Error > > > > > > > > > > >bundle="systemerrorbundle"/> > > > > > > > > > > > > > > > > > There's more to this story. Notice the line: > > > This is where I supply a customer message. The message is > externalized in a properties file for I18N. This is my > syserror.jsp page which is referenced in the struts.xml config. > > > > -Original Message- > From: Brian McGovern <[EMAIL PROTECTED]> > Sent: Feb 15, 2005 11:24 AM > To: Struts Users Mailing List , > [EMAIL PROTECTED] > Subject: RE: Proper n tiered exception handling > > Jim, > So in this approach you really dont use any try catch blocks > at all? or you just re - throw the original exception that you caught? > > How do you grab the error on the JSP page? > > Thanks > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 15, 2005 11:16 AM > To: Struts Users Mailing List > Subject: Re: Proper n tiered exception handling > > > I use declaritive exception handling which is built into > Struts. Works great for me. I really don't use custom > exceptions that much any more because it's harder to track > the original error. Also, I don't clutter my code with alot > of try/catch blocks unless it's absolutely necessary. I > allow all exceptions to propagate through the Struts built-in > exception handling framework. > > Here is an example of declaritive exception handling in the > struts config: > > >
RE: html-el oddities
that is odd. make sure your tag definition is pointing to the EL tld, you may have updated the tag handle but not the tld reference? --- Trevor Hill <[EMAIL PROTECTED]> wrote: > Thanks -- your option (2) seems to be working fairly well for me now. > I still have to see if struts will accept the faked up input tag and > stick the data into the form bean, but I don't see any reason why > that shouldn't work. > > I wonder why (1) wouldn't work for me though -- it gave me the same > result as the JSTL tag did. (It iterated fine but would just print > out ${cur.prdNumber} rather than the actual vaule) > > It seems odd that the EL tag does everything except actually do the > EL-evaulation. > > --Trevor > > -Original Message- > From: Woodchuck [mailto:[EMAIL PROTECTED] > Sent: February 15, 2005 10:31 AM > To: Struts Users Mailing List > Subject: RE: html-el oddities > > > i can think of 2 things you can try: > > > 1) use instead of > > i have found that jstl-scoped objects do not always work well with > struts tags > > > 2) simply don't use the tag > > you can achieve the same result with: > > maxlength="5" size="3" value=""> > > > hth, > woodchuck > > > --- Trevor Hill <[EMAIL PROTECTED]> wrote: > > > To try and attack this question from another angle, is there any > > reason that this wouldn't work (or would work differently) in > > Struts(-el) 1.1 as opposed to 1.2.x? I'm limited to using 1.1 > only, > > but cannot find any old 1.1 documentation to work from. > > > > Thanks, > > --Trevor > > > > -Original Message- > > From: Trevor Hill > > Sent: February 14, 2005 8:33 AM > > To: Struts Users Mailing List > > Subject: RE: html-el oddities > > > > > > As I said in my original question, I had tried 'cur.prdNumber' and > > had the same result, and so had tried shoving the value of > > cur.prdNumber into a page-scoped variable named 'curPrdNumber', > with > > the exact same less-than-spectacular results. > > > > So I guess I'm still stuck, but thanks. > > > > -Original Message- > > From: Jason Lea [mailto:[EMAIL PROTECTED] > > Sent: February 11, 2005 4:54 PM > > To: Struts Users Mailing List > > Subject: Re: html-el oddities > > > > > > I think you are missing a dot :) cur.PrdNumber not curPrdNumber > > > > Try: > > > > > size="3" value=""> > > > > > > > > > > > > > > Trevor Hill wrote: > > > > >I'm having an interesting issue. I have a form in which the only > > input is a bunch of text boxes which correspond to quantities of > > products. The associated form thus consists of just a HashMap. My > > JSP page is as follows: > > ><... header stuff ...> > > > > > > > > > Product > > > Product Number > > > Price > > > Quantity to add > > > > > > > > > > > > > > > > > > > > > > > > > > >> currencyCode="${cur.currencyCode}" value="${cur.price}"/> > > > > > >> property="quantity(${curPrdNumber})" size="3" maxlength="5" /> > > > > > > > > ><... submit button, close form, etc> > > > > > > > > > > > >However, the output of the last TD is: > > > > > > > size="3" value=""> > > > > > >which is correct except for that whole "not interpreting the EL > > expression" bit. > > > > > >I've tried using a page-scoped temporary variable (as above), I've > > tried directly referencing ${cur.prdNumber} in the html-el:text > tag, > > I've checked all my TLDs and the struts-el.jar files to ensure > > they're in the correct place and checked the web.xml file to make > > sure all the TLDs are mentioned. There are no error messages in my > > application's log or my application server's log that would suggest > > some class or configuration file being out of whack. > > > > > >All my other taglibs (normal struts tags and jstl tags) are > working > > just fine, and the html-el tag /seems/ to work fine from a Struts > > standpoint in that it makes an just like it > > should, but no el-evaluation. This problem doesn't appear to be > > specific to the mapped property "quantity", as I can try other > > html-el tags that directly refer to either ${curPrdNumber} or > > {$cur.prdNumber}, and I get the same result -- no evaluation. > > > > > >Am I missing something glaringly obvious? > > > > > >Thanks, > > >--Trevor > > > > > > > > > > > > >- > > >This transmission (including any attachments) may contain > > confidential information, privileged material (including material > > protected by the solicitor-client or other applicable privileges), > or > > constitute non-public information. Any use of this information by > > anyone other than the intended recipient is prohibited. If you have > > received this transmission in error, please immediately reply to > the > > sender and delete this information from your system. Use, > > dissemination, distribution, or reproduction of this transmission > by > > unintended recipients is not authorized and may be unlawful. > > > > > > >
Re: Proper n tiered exception handling
Different applications have different requirements. Take a look at the exception handling in the workeffort application download http://www.logicden.com to get an idea. The files you may want to look at are: ApplicationExceptionHandler.java, files in package com.logicden.workeffort.service.exception, struts-config.xml, sql-error-codes.xml. Note that the application uses Spring and the SQL exceptions get translated to custom exceptions using the mappings in sql-error-codes.xml. This allows me to support multiple databases and keep with the layers of the application agnostic of the target database. The actions generally don't have any try/catch blocks. I let struts handle the exceptions. - Original Message - From: "Brian McGovern" To: user@struts.apache.org Subject: Proper n tiered exception handling Date: Tue, 15 Feb 2005 10:28:27 -0500 > > I'm looking to get a handle on best exception handling practices in > my app. Kinda beginner question i guess, sorry. > > Im catching the various sql and naming exceptions in the data > classes and logging and throwing a custom exception called > ApplicationException which is blank and provided below. I've read > up but an still a little confused on how exactly to build this > exception class to extend the available struts exception classes > that would gracefully map to an error display jsp where i could > display the error to the user. Right now I just get the HTTP > status 500 strack trace on the screen. > > Controller snippet that catches the data obj's thrown ApplicationException: > > try { > zRepBeanBn = > MyData.getRepByID(StringUtils.convertToInt(request.getParameter("RepID"))); > }catch (ApplicationException zAppEx){ > throw zAppEx; > } > > > ApplicationException that needs work: How do I extend this? > > public class ApplicationException extends Exception { > public ApplicationException(String message) { } > } > > > Thanks http://www.logicden.com -- ___ Find what you are looking for with the Lycos Yellow Pages http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Proper n tiered exception handling
I probably have not shown you enough in terms of setup. There is more to configure this completely. I will try to outline this shortly. To answer your question , I don't rethrow anything. It's not necessary. Your struts actions have the following signature: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) throws Exception { ... } Any exception thrown within this method with propagate up through the exception handling framework. Whether it's a SQLException, RemoteException or any checked or runtime exception will flow upward. You delcare where to forward to (what page). I designed a generic error handling jsp, because I did not want to design a separate JSP for every type of exception. This is a preference thing. My way was right for me. Here is my JSP for handling errors: <[EMAIL PROTECTED] import="java.util.*" %> <[EMAIL PROTECTED] uri="/WEB-INF/taglibs-log.tld" prefix="log" %> <[EMAIL PROTECTED] uri="/WEB-INF/fmt.tld" prefix="fmt" %> <[EMAIL PROTECTED] uri="/WEB-INF/c.tld" prefix="c" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <% Throwable t = (Throwable)request.getAttribute("org.apache.struts.action.EXCEPTION"); if ( t!= null) { StackTraceElement [] trace = t.getStackTrace(); int size = trace.length; out.print(""); } %> System Error There's more to this story. Notice the line: This is where I supply a customer message. The message is externalized in a properties file for I18N. This is my syserror.jsp page which is referenced in the struts.xml config. -Original Message- From: Brian McGovern <[EMAIL PROTECTED]> Sent: Feb 15, 2005 11:24 AM To: Struts Users Mailing List , [EMAIL PROTECTED] Subject: RE: Proper n tiered exception handling Jim, So in this approach you really dont use any try catch blocks at all? or you just re - throw the original exception that you caught? How do you grab the error on the JSP page? Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 11:16 AM To: Struts Users Mailing List Subject: Re: Proper n tiered exception handling I use declaritive exception handling which is built into Struts. Works great for me. I really don't use custom exceptions that much any more because it's harder to track the original error. Also, I don't clutter my code with alot of try/catch blocks unless it's absolutely necessary. I allow all exceptions to propagate through the Struts built-in exception handling framework. Here is an example of declaritive exception handling in the struts config: When these exception types are thrown, the user is forwarded to the proper custom page. If your creative you can grab the current error and print the stack trace as an HTML comment within the page for your review. You can then view the exception stack trace by selecting view/source from you browser. Only show the user and nice "pretty" message. Jim -Original Message- From: Brian McGovern <[EMAIL PROTECTED]> Sent: Feb 15, 2005 10:28 AM To: user@struts.apache.org Subject: Proper n tiered exception handling I'm looking to get a handle on best exception handling practices in my app. Kinda beginner question i guess, sorry. Im catching the various sql and naming exceptions in the data classes and logging and throwing a custom exception called ApplicationException which is blank and provided below. I've read up but an still a little confused on how exactly to build this exception class to extend the available struts exception classes that would gracefully map to an error display jsp where i could display the error to the user. Right now I just get the HTTP status 500 strack trace on the screen. Controller snippet that catches the data obj's thrown ApplicationException: try { zRepBeanBn = MyData.getRepByID(StringUtils.convertToInt(request.getParameter("RepID"))); }catch (ApplicationException zAppEx){ throw zAppEx; } ApplicationException that needs work: How do I extend th
RE: Construting HTML Email from Struts
http://article.gmane.org/gmane.comp.jakarta.taglibs.user/6038 I helped someone a while back with a similar requirement. Hope its useful. Chris McCormack -Original Message- From: Todd Nine [mailto:[EMAIL PROTECTED] Sent: 15 February 2005 12:50 To: Struts Users Mailing List Subject: Construting HTML Email from Struts Hi all, Does anyone know of a way to construct an HTML formatted email using a struts jsp and a DynaForm? I want our visual designers to be able to updload an email "template", which is just a Struts jsp with the dynabean properties. We would then upload a mapping (something like hql in nature), that would query our database, and fill in the dynabean. The batch job would fire and create the html from the struts jsp, inserting into the body. We would then email that text. Any Ideas? Todd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * This e-mail and its attachments are confidential and are intended for the above named recipient only. If this has come to you in error, please notify the sender immediately and delete this e-mail from your system. You must take no action based on this, nor must you copy or disclose it or any part of its contents to any person or organisation. Statements and opinions contained in this email may not necessarily represent those of Littlewoods. Please note that e-mail communications may be monitored. The registered office of Littlewoods Limited and it's subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB. Registered number of Littlewoods Limited is 262152. * This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Proper n tiered exception handling
Jim, So in this approach you really dont use any try catch blocks at all? or you just re - throw the original exception that you caught? How do you grab the error on the JSP page? Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 11:16 AM To: Struts Users Mailing List Subject: Re: Proper n tiered exception handling I use declaritive exception handling which is built into Struts. Works great for me. I really don't use custom exceptions that much any more because it's harder to track the original error. Also, I don't clutter my code with alot of try/catch blocks unless it's absolutely necessary. I allow all exceptions to propagate through the Struts built-in exception handling framework. Here is an example of declaritive exception handling in the struts config: When these exception types are thrown, the user is forwarded to the proper custom page. If your creative you can grab the current error and print the stack trace as an HTML comment within the page for your review. You can then view the exception stack trace by selecting view/source from you browser. Only show the user and nice "pretty" message. Jim -Original Message- From: Brian McGovern <[EMAIL PROTECTED]> Sent: Feb 15, 2005 10:28 AM To: user@struts.apache.org Subject: Proper n tiered exception handling I'm looking to get a handle on best exception handling practices in my app. Kinda beginner question i guess, sorry. Im catching the various sql and naming exceptions in the data classes and logging and throwing a custom exception called ApplicationException which is blank and provided below. I've read up but an still a little confused on how exactly to build this exception class to extend the available struts exception classes that would gracefully map to an error display jsp where i could display the error to the user. Right now I just get the HTTP status 500 strack trace on the screen. Controller snippet that catches the data obj's thrown ApplicationException: try { zRepBeanBn = MyData.getRepByID(StringUtils.convertToInt(request.getParameter("RepID"))); }catch (ApplicationException zAppEx){ throw zAppEx; } ApplicationException that needs work: How do I extend this? public class ApplicationException extends Exception { public ApplicationException(String message) { } } Thanks - 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: Proper n tiered exception handling
I use declaritive exception handling which is built into Struts. Works great for me. I really don't use custom exceptions that much any more because it's harder to track the original error. Also, I don't clutter my code with alot of try/catch blocks unless it's absolutely necessary. I allow all exceptions to propagate through the Struts built-in exception handling framework. Here is an example of declaritive exception handling in the struts config: When these exception types are thrown, the user is forwarded to the proper custom page. If your creative you can grab the current error and print the stack trace as an HTML comment within the page for your review. You can then view the exception stack trace by selecting view/source from you browser. Only show the user and nice "pretty" message. Jim -Original Message- From: Brian McGovern <[EMAIL PROTECTED]> Sent: Feb 15, 2005 10:28 AM To: user@struts.apache.org Subject: Proper n tiered exception handling I'm looking to get a handle on best exception handling practices in my app. Kinda beginner question i guess, sorry. Im catching the various sql and naming exceptions in the data classes and logging and throwing a custom exception called ApplicationException which is blank and provided below. I've read up but an still a little confused on how exactly to build this exception class to extend the available struts exception classes that would gracefully map to an error display jsp where i could display the error to the user. Right now I just get the HTTP status 500 strack trace on the screen. Controller snippet that catches the data obj's thrown ApplicationException: try { zRepBeanBn = MyData.getRepByID(StringUtils.convertToInt(request.getParameter("RepID"))); }catch (ApplicationException zAppEx){ throw zAppEx; } ApplicationException that needs work: How do I extend this? public class ApplicationException extends Exception { public ApplicationException(String message) { } } Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html-el oddities
Thanks -- your option (2) seems to be working fairly well for me now. I still have to see if struts will accept the faked up input tag and stick the data into the form bean, but I don't see any reason why that shouldn't work. I wonder why (1) wouldn't work for me though -- it gave me the same result as the JSTL tag did. (It iterated fine but would just print out ${cur.prdNumber} rather than the actual vaule) It seems odd that the EL tag does everything except actually do the EL-evaulation. --Trevor -Original Message- From: Woodchuck [mailto:[EMAIL PROTECTED] Sent: February 15, 2005 10:31 AM To: Struts Users Mailing List Subject: RE: html-el oddities i can think of 2 things you can try: 1) use instead of i have found that jstl-scoped objects do not always work well with struts tags 2) simply don't use the tag you can achieve the same result with: hth, woodchuck --- Trevor Hill <[EMAIL PROTECTED]> wrote: > To try and attack this question from another angle, is there any > reason that this wouldn't work (or would work differently) in > Struts(-el) 1.1 as opposed to 1.2.x? I'm limited to using 1.1 only, > but cannot find any old 1.1 documentation to work from. > > Thanks, > --Trevor > > -Original Message- > From: Trevor Hill > Sent: February 14, 2005 8:33 AM > To: Struts Users Mailing List > Subject: RE: html-el oddities > > > As I said in my original question, I had tried 'cur.prdNumber' and > had the same result, and so had tried shoving the value of > cur.prdNumber into a page-scoped variable named 'curPrdNumber', with > the exact same less-than-spectacular results. > > So I guess I'm still stuck, but thanks. > > -Original Message- > From: Jason Lea [mailto:[EMAIL PROTECTED] > Sent: February 11, 2005 4:54 PM > To: Struts Users Mailing List > Subject: Re: html-el oddities > > > I think you are missing a dot :) cur.PrdNumber not curPrdNumber > > Try: > > size="3" value=""> > > > > > > > Trevor Hill wrote: > > >I'm having an interesting issue. I have a form in which the only > input is a bunch of text boxes which correspond to quantities of > products. The associated form thus consists of just a HashMap. My > JSP page is as follows: > ><... header stuff ...> > > > > > > Product > > Product Number > > Price > > Quantity to add > > > > > > > > > > > > > > > > > > currencyCode="${cur.currencyCode}" value="${cur.price}"/> > > > > property="quantity(${curPrdNumber})" size="3" maxlength="5" /> > > > > > ><... submit button, close form, etc> > > > > > > > >However, the output of the last TD is: > > > > size="3" value=""> > > > >which is correct except for that whole "not interpreting the EL > expression" bit. > > > >I've tried using a page-scoped temporary variable (as above), I've > tried directly referencing ${cur.prdNumber} in the html-el:text tag, > I've checked all my TLDs and the struts-el.jar files to ensure > they're in the correct place and checked the web.xml file to make > sure all the TLDs are mentioned. There are no error messages in my > application's log or my application server's log that would suggest > some class or configuration file being out of whack. > > > >All my other taglibs (normal struts tags and jstl tags) are working > just fine, and the html-el tag /seems/ to work fine from a Struts > standpoint in that it makes an just like it > should, but no el-evaluation. This problem doesn't appear to be > specific to the mapped property "quantity", as I can try other > html-el tags that directly refer to either ${curPrdNumber} or > {$cur.prdNumber}, and I get the same result -- no evaluation. > > > >Am I missing something glaringly obvious? > > > >Thanks, > >--Trevor > > > > > > > >- > >This transmission (including any attachments) may contain > confidential information, privileged material (including material > protected by the solicitor-client or other applicable privileges), or > constitute non-public information. Any use of this information by > anyone other than the intended recipient is prohibited. If you have > received this transmission in error, please immediately reply to the > sender and delete this information from your system. Use, > dissemination, distribution, or reproduction of this transmission by > unintended recipients is not authorized and may be unlawful. > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > -- > Jason Lea > > > > > -- > No virus found in this outgoing message. > Checked by AVG Anti-Virus. > Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 2005.02.10 > > > > > - > This transmission (including any attachments) may contain > confidential information
Re: Caching Appliction Level Data?
>> how do you manage cross container caches if you are clustered - when >> you are using static members on classes? How do guarantee sameness on >> different physical machines? We do have a few caches in our >> application and are facing issues due to this design or an improperly >> implemented version of this design. Also, be aware that caching can actually degrade application performance in some cases. Everything you cache takes space in the JVM heap, reducing what's left to process active requests. So it's possible to lose more cycles in GC than you saved by caching in the first place. You can just keep increasing -Xmx, but that can hurt you if the JVM starts using swap space/virtual memory for the Java heap. If you're using a clustered cache, you also have the overhead of keeping the caches on each JVM in sync. That adds network as well as processing overhead for marshalling and unmarshalling cached objects. In summary, J2EE webapp performance involves a lot of tradeoffs. Caching is important but has to be used judiciously to be beneficial. -- Bill -- Bill Schneider Chief Architect Vecna Technologies 5004 Lehigh Rd., Suite B College Park, MD 20740 [EMAIL PROTECTED] t: 301-864-7253 x1140 f: 301-699-3180 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validator, Indexed Properties and error messages.
Hello all, In review various documentation and several google search's I have found how to use the validator framework to validate indexed properties. In looking at the javadocs for the validator framework I see that the field class has an attribute called 'property' which (I think) tells the validator what property to associate any error message encountered during validation. My question is how do we associate the indexed properties error messages with different properties in the errors queue? For instance, if I have an indexed property that represents a list of items is there anyway to associate any error message for item 1 in the list using the property field. I want something like itemX as the property when the ActionMessage is placed into the queue as the property where the X represents the index of the item that the error happened on? Thanks for any Help Jamie Cruz Software Engineering - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html-el oddities
From: "Trevor Hill" <[EMAIL PROTECTED]> > I'm limited to using 1.1 only, but cannot find any old 1.1 documentation to work from. There should be a 'struts-documentation.war' contained in the 1.1 distribution. That will have docs that match what's in 1.1, as opposed to the more current ones on the website. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html-el oddities
i can think of 2 things you can try: 1) use instead of i have found that jstl-scoped objects do not always work well with struts tags 2) simply don't use the tag you can achieve the same result with: hth, woodchuck --- Trevor Hill <[EMAIL PROTECTED]> wrote: > To try and attack this question from another angle, is there any > reason that this wouldn't work (or would work differently) in > Struts(-el) 1.1 as opposed to 1.2.x? I'm limited to using 1.1 only, > but cannot find any old 1.1 documentation to work from. > > Thanks, > --Trevor > > -Original Message- > From: Trevor Hill > Sent: February 14, 2005 8:33 AM > To: Struts Users Mailing List > Subject: RE: html-el oddities > > > As I said in my original question, I had tried 'cur.prdNumber' and > had the same result, and so had tried shoving the value of > cur.prdNumber into a page-scoped variable named 'curPrdNumber', with > the exact same less-than-spectacular results. > > So I guess I'm still stuck, but thanks. > > -Original Message- > From: Jason Lea [mailto:[EMAIL PROTECTED] > Sent: February 11, 2005 4:54 PM > To: Struts Users Mailing List > Subject: Re: html-el oddities > > > I think you are missing a dot :) cur.PrdNumber not curPrdNumber > > Try: > > size="3" value=""> > > > > > > > Trevor Hill wrote: > > >I'm having an interesting issue. I have a form in which the only > input is a bunch of text boxes which correspond to quantities of > products. The associated form thus consists of just a HashMap. My > JSP page is as follows: > ><... header stuff ...> > > > > > > Product > > Product Number > > Price > > Quantity to add > > > > > > > > > > > > > > > > > > currencyCode="${cur.currencyCode}" value="${cur.price}"/> > > > > property="quantity(${curPrdNumber})" size="3" maxlength="5" /> > > > > > ><... submit button, close form, etc> > > > > > > > >However, the output of the last TD is: > > > > size="3" value=""> > > > >which is correct except for that whole "not interpreting the EL > expression" bit. > > > >I've tried using a page-scoped temporary variable (as above), I've > tried directly referencing ${cur.prdNumber} in the html-el:text tag, > I've checked all my TLDs and the struts-el.jar files to ensure > they're in the correct place and checked the web.xml file to make > sure all the TLDs are mentioned. There are no error messages in my > application's log or my application server's log that would suggest > some class or configuration file being out of whack. > > > >All my other taglibs (normal struts tags and jstl tags) are working > just fine, and the html-el tag /seems/ to work fine from a Struts > standpoint in that it makes an just like it > should, but no el-evaluation. This problem doesn't appear to be > specific to the mapped property "quantity", as I can try other > html-el tags that directly refer to either ${curPrdNumber} or > {$cur.prdNumber}, and I get the same result -- no evaluation. > > > >Am I missing something glaringly obvious? > > > >Thanks, > >--Trevor > > > > > > > >- > >This transmission (including any attachments) may contain > confidential information, privileged material (including material > protected by the solicitor-client or other applicable privileges), or > constitute non-public information. Any use of this information by > anyone other than the intended recipient is prohibited. If you have > received this transmission in error, please immediately reply to the > sender and delete this information from your system. Use, > dissemination, distribution, or reproduction of this transmission by > unintended recipients is not authorized and may be unlawful. > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > -- > Jason Lea > > > > > -- > No virus found in this outgoing message. > Checked by AVG Anti-Virus. > Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 2005.02.10 > > > > > - > This transmission (including any attachments) may contain > confidential information, privileged material (including material > protected by the solicitor-client or other applicable privileges), or > constitute non-public information. Any use of this information by > anyone other than the intended recipient is prohibited. If you have > received this transmission in error, please immediately reply to the > sender and delete this information from your system. Use, > dissemination, distribution, or reproduction of this transmission by > unintended recipients is not authorized and may be unlawful. > > > > - > This transmission (including any attachments) may contain > confidential infor
Re: Construting HTML Email from Struts
Niall, What is the origin of the "emailStuff" in this wiki page? Thanks. On Tue, 15 Feb 2005 14:25:29 -, Niall Pemberton <[EMAIL PROTECTED]> wrote: > I posted this for someone who asked a similar quesiton recently. > > http://www.niallp.pwp.blueyonder.co.uk/emailTemplate.html > > Niall -- The radiance of all the stars does not equal a sixteenth part of the moon's radiance, likewise, good deeds giving us merit, all these do not equal a sixteenth part of the merit of loving-kindness.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Proper n tiered exception handling
I'm looking to get a handle on best exception handling practices in my app. Kinda beginner question i guess, sorry. Im catching the various sql and naming exceptions in the data classes and logging and throwing a custom exception called ApplicationException which is blank and provided below. I've read up but an still a little confused on how exactly to build this exception class to extend the available struts exception classes that would gracefully map to an error display jsp where i could display the error to the user. Right now I just get the HTTP status 500 strack trace on the screen. Controller snippet that catches the data obj's thrown ApplicationException: try { zRepBeanBn = MyData.getRepByID(StringUtils.convertToInt(request.getParameter("RepID"))); }catch (ApplicationException zAppEx){ throw zAppEx; } ApplicationException that needs work: How do I extend this? public class ApplicationException extends Exception { public ApplicationException(String message) { } } Thanks
RE: html-el oddities
To try and attack this question from another angle, is there any reason that this wouldn't work (or would work differently) in Struts(-el) 1.1 as opposed to 1.2.x? I'm limited to using 1.1 only, but cannot find any old 1.1 documentation to work from. Thanks, --Trevor -Original Message- From: Trevor Hill Sent: February 14, 2005 8:33 AM To: Struts Users Mailing List Subject: RE: html-el oddities As I said in my original question, I had tried 'cur.prdNumber' and had the same result, and so had tried shoving the value of cur.prdNumber into a page-scoped variable named 'curPrdNumber', with the exact same less-than-spectacular results. So I guess I'm still stuck, but thanks. -Original Message- From: Jason Lea [mailto:[EMAIL PROTECTED] Sent: February 11, 2005 4:54 PM To: Struts Users Mailing List Subject: Re: html-el oddities I think you are missing a dot :) cur.PrdNumber not curPrdNumber Try: Trevor Hill wrote: >I'm having an interesting issue. I have a form in which the only input is a >bunch of text boxes which correspond to quantities of products. The >associated form thus consists of just a HashMap. My JSP page is as follows: ><... header stuff ...> > > > Product > Product Number > Price > Quantity to add > > > > > > > > >currencyCode="${cur.currencyCode}" value="${cur.price}"/> > >property="quantity(${curPrdNumber})" size="3" maxlength="5" /> > > ><... submit button, close form, etc> > > > >However, the output of the last TD is: > >value=""> > >which is correct except for that whole "not interpreting the EL expression" >bit. > >I've tried using a page-scoped temporary variable (as above), I've tried >directly referencing ${cur.prdNumber} in the html-el:text tag, I've checked >all my TLDs and the struts-el.jar files to ensure they're in the correct place >and checked the web.xml file to make sure all the TLDs are mentioned. There >are no error messages in my application's log or my application server's log >that would suggest some class or configuration file being out of whack. > >All my other taglibs (normal struts tags and jstl tags) are working just fine, >and the html-el tag /seems/ to work fine from a Struts standpoint in that it >makes an just like it should, but no el-evaluation. This >problem doesn't appear to be specific to the mapped property "quantity", as I >can try other html-el tags that directly refer to either ${curPrdNumber} or >{$cur.prdNumber}, and I get the same result -- no evaluation. > >Am I missing something glaringly obvious? > >Thanks, >--Trevor > > > >- >This transmission (including any attachments) may contain confidential >information, privileged material (including material protected by the >solicitor-client or other applicable privileges), or constitute non-public >information. Any use of this information by anyone other than the intended >recipient is prohibited. If you have received this transmission in error, >please immediately reply to the sender and delete this information from your >system. Use, dissemination, distribution, or reproduction of this transmission >by unintended recipients is not authorized and may be unlawful. > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > -- Jason Lea -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 2005.02.10 - This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful. - This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful. ---
Re: Construting HTML Email from Struts
At 7:50 AM -0500 2/15/05, Todd Nine wrote: Hi all, Does anyone know of a way to construct an HTML formatted email using a struts jsp and a DynaForm? I want our visual designers to be able to updload an email "template", which is just a Struts jsp with the dynabean properties. We would then upload a mapping (something like hql in nature), that would query our database, and fill in the dynabean. The batch job would fire and create the html from the struts jsp, inserting into the body. We would then email that text. It's pretty awkward to use JSP to render templated text not to a browser; I've settled on using Velocity for that even though we still use JSP for web pages. You could probably work out a way to call a URL from within your Java code to retrieve a page and use the results as the body of your email, if you really wanted to stick with JSP. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Construting HTML Email from Struts
Nils, When you say special tags, do you mean creating custom tags? The reason I want to have this dynamic environment is so that we can upload content without the need to deploy another ear. This way when the business people change the content of the email, we can easily upload a new format and send out the email. On Tue, 15 Feb 2005 15:31:38 +0200, Nils Liebelt <[EMAIL PROTECTED]> wrote: > Sounds a bit complicated! Why do you need > to have struts tags? I would go for plain html and add > special tags for whatever you need. > Path of least resistence... > > GreetZ > > Nils > > -Original Message- > From: Todd Nine [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 15, 2005 2:50 PM > To: Struts Users Mailing List > Subject: Construting HTML Email from Struts > > Hi all, >Does anyone know of a way to construct an HTML formatted email > using a struts jsp and a DynaForm? I want our visual designers to be > able to updload an email "template", which is just a Struts jsp with > the dynabean properties. We would then upload a mapping (something > like hql in nature), that would query our database, and fill in the > dynabean. The batch job would fire and create the html from the > struts jsp, inserting into the body. We would then email that text. > > Any Ideas? > Todd > > - > 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: Construting HTML Email from Struts
I posted this for someone who asked a similar quesiton recently. http://www.niallp.pwp.blueyonder.co.uk/emailTemplate.html Niall - Original Message - From: "Todd Nine" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, February 15, 2005 12:50 PM Subject: Construting HTML Email from Struts > Hi all, >Does anyone know of a way to construct an HTML formatted email > using a struts jsp and a DynaForm? I want our visual designers to be > able to updload an email "template", which is just a Struts jsp with > the dynabean properties. We would then upload a mapping (something > like hql in nature), that would query our database, and fill in the > dynabean. The batch job would fire and create the html from the > struts jsp, inserting into the body. We would then email that text. > > Any Ideas? > Todd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Construting HTML Email from Struts
Sounds a bit complicated! Why do you need to have struts tags? I would go for plain html and add special tags for whatever you need. Path of least resistence... GreetZ Nils -Original Message- From: Todd Nine [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 2:50 PM To: Struts Users Mailing List Subject: Construting HTML Email from Struts Hi all, Does anyone know of a way to construct an HTML formatted email using a struts jsp and a DynaForm? I want our visual designers to be able to updload an email "template", which is just a Struts jsp with the dynabean properties. We would then upload a mapping (something like hql in nature), that would query our database, and fill in the dynabean. The batch job would fire and create the html from the struts jsp, inserting into the body. We would then email that text. Any Ideas? Todd - 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: Construting HTML Email from Struts
Sounds a bit complicated! Why do you need to have struts tags? I would go for plain html and add special tags for whatever you need. Path of least resistence... GreetZ Nils -Original Message- From: Todd Nine [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 2:50 PM To: Struts Users Mailing List Subject: Construting HTML Email from Struts Hi all, Does anyone know of a way to construct an HTML formatted email using a struts jsp and a DynaForm? I want our visual designers to be able to updload an email "template", which is just a Struts jsp with the dynabean properties. We would then upload a mapping (something like hql in nature), that would query our database, and fill in the dynabean. The batch job would fire and create the html from the struts jsp, inserting into the body. We would then email that text. Any Ideas? Todd - 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]
Construting HTML Email from Struts
Hi all, Does anyone know of a way to construct an HTML formatted email using a struts jsp and a DynaForm? I want our visual designers to be able to updload an email "template", which is just a Struts jsp with the dynabean properties. We would then upload a mapping (something like hql in nature), that would query our database, and fill in the dynabean. The batch job would fire and create the html from the struts jsp, inserting into the body. We would then email that text. Any Ideas? Todd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to pass variable from servlet to jsp?
I suppose that 'crazy'/'bad' refers to the classical jsp-way of working, without using the struts-framework. When using struts, I would advise to use forms (a subject that I am starting to tackle right now as well...) Jan-Jaap --- "Daffin, Miles (Company IT)" <[EMAIL PROTECTED]> wrote: > Why is that 'crazy' or 'bad'? Please elaborate. > > > -Original Message- > > From: Larry Meadors > [mailto:[EMAIL PROTECTED] > > Sent: 11 February 2005 16:43 > > To: Struts Users Mailing List; [EMAIL PROTECTED] > > Subject: Re: How to pass variable from servlet to > jsp? > > > > No offense, but that is *crazy* *bad* advice > Frank. > > > > Larry > > > > On Fri, 11 Feb 2005 11:22:26 -0500 (EST), Frank W. > Zammetti > > (MLists) <[EMAIL PROTECTED]> wrote: > > > <%@ page language="java" %> > > > <% String temp_ = > (String)request.getAttribute("temp_"); %> > > > test My > string is <%=temp_%> > > > > > > > > - > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > NOTICE: If received in error, please destroy and > notify sender. Sender does not waive > confidentiality or privilege, and use is prohibited. > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to pass variable from servlet to jsp?
Why is that 'crazy' or 'bad'? Please elaborate. > -Original Message- > From: Larry Meadors [mailto:[EMAIL PROTECTED] > Sent: 11 February 2005 16:43 > To: Struts Users Mailing List; [EMAIL PROTECTED] > Subject: Re: How to pass variable from servlet to jsp? > > No offense, but that is *crazy* *bad* advice Frank. > > Larry > > On Fri, 11 Feb 2005 11:22:26 -0500 (EST), Frank W. Zammetti > (MLists) <[EMAIL PROTECTED]> wrote: > > <%@ page language="java" %> > > <% String temp_ = (String)request.getAttribute("temp_"); %> > > test My string is <%=temp_%> > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Antwort: Re: Antwort: bean:include
Hi! Nothing special here. Let's say you've an struts action like this: The referenced variable.jsp itself has a java scriptlet like this: <% String typePage = "/variable/detail_" + container.getType() + ".jsp"; %> In my html-table of individual contents I just : So, Struts is not really involved. Regards Karsten Krieg intarsys consulting GmbH Fon +49 (0)721 3 84 79 - 28 Fax +49 (0)721 3 84 79 - 60 e-mail [EMAIL PROTECTED] http://www.intarsys.de "Iran! That's where the weapons of mass destruction were! It was a typo all along!" wo shi ni baba <[EMAIL PROTECTED]> schrieb am 15.02.2005 09:31:19: > hi, thanks, but would you tell me how to do it in > struts? > > --- Karsten Krieg <[EMAIL PROTECTED]> wrote: > > > > > Hi! > > > > Why not just use jsp:include. There's nothing wrong > > with it. You can even > > use a request attribute for setting the jsp page. > > > > > > > > Regards > > Karsten Krieg > > intarsys consulting GmbH > > > > Fon +49 (0)721 3 84 79 - 28 > > Fax +49 (0)721 3 84 79 - 60 > > e-mail [EMAIL PROTECTED] > > http://www.intarsys.de > > > > "Iran! That's where the weapons of mass destruction > > were! It was a typo all > > along!" > > > > wo shi ni baba <[EMAIL PROTECTED]> schrieb > > am 15.02.2005 03:54:38: > > > > > Hi folks, > > > I am new to struts, I am trying to get the > > equivalent > > > of jsp:include in struts. I tried > > > > > > this itself does not actually print the content. > > what > > > else do I need to do to get Top.jsp onto the > > screen? > > > thanks in advance > > > > > > > > > > > > > > > __ > > > Do you Yahoo!? > > > The all-new My Yahoo! - What will yours do? > > > http://my.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!? > All your favorites on one personal page ? Try My Yahoo! > http://my.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: MESSAGES_KEY not found in request
I finally found them. After going through some struts sources. The messages are stored under: session.getServletContext().getAttribute(Action.MESSAGES_KEY) I was mislead by some examples in the web where you are told to fetch them via: request.getAttribute(Action.MESSAGES_KEY); Best regards René Thol René Thol schrieb: Hello again, since I'm stuck to struts1.0.2 and there's no way to disable filtering when using bean:message I'm trying to access MessageResources directly within my JSPs. But there is no entry regarding the Action.MESSAGES_KEY. Neither within the request nor within the session. I'm going through all request parameters and attributes within my Action's perform method after calling super.perform(...). No entry is found! So my question is: How does bean:message find the entries if they are not set according to the documentation!? Many thanks in advance Kind regards -- René Thol E-Mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Antwort: bean:include
hi, thanks, but would you tell me how to do it in struts? --- Karsten Krieg <[EMAIL PROTECTED]> wrote: > > Hi! > > Why not just use jsp:include. There's nothing wrong > with it. You can even > use a request attribute for setting the jsp page. > > > > Regards > Karsten Krieg > intarsys consulting GmbH > > Fon +49 (0)721 3 84 79 - 28 > Fax +49 (0)721 3 84 79 - 60 > e-mail [EMAIL PROTECTED] > http://www.intarsys.de > > "Iran! That's where the weapons of mass destruction > were! It was a typo all > along!" > > wo shi ni baba <[EMAIL PROTECTED]> schrieb > am 15.02.2005 03:54:38: > > > Hi folks, > > I am new to struts, I am trying to get the > equivalent > > of jsp:include in struts. I tried > > > > this itself does not actually print the content. > what > > else do I need to do to get Top.jsp onto the > screen? > > thanks in advance > > > > > > > > > > __ > > Do you Yahoo!? > > The all-new My Yahoo! - What will yours do? > > http://my.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!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
MESSAGES_KEY not found in request
Hello again, since I'm stuck to struts1.0.2 and there's no way to disable filtering when using bean:message I'm trying to access MessageResources directly within my JSPs. But there is no entry regarding the Action.MESSAGES_KEY. Neither within the request nor within the session. I'm going through all request parameters and attributes within my Action's perform method after calling super.perform(...). No entry is found! So my question is: How does bean:message find the entries if they are not set according to the documentation!? Many thanks in advance Kind regards -- René Thol E-Mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Antwort: bean:include
Hi! Why not just use jsp:include. There's nothing wrong with it. You can even use a request attribute for setting the jsp page. Regards Karsten Krieg intarsys consulting GmbH Fon +49 (0)721 3 84 79 - 28 Fax +49 (0)721 3 84 79 - 60 e-mail [EMAIL PROTECTED] http://www.intarsys.de "Iran! That's where the weapons of mass destruction were! It was a typo all along!" wo shi ni baba <[EMAIL PROTECTED]> schrieb am 15.02.2005 03:54:38: > Hi folks, > I am new to struts, I am trying to get the equivalent > of jsp:include in struts. I tried > > this itself does not actually print the content. what > else do I need to do to get Top.jsp onto the screen? > thanks in advance > > > > > __ > Do you Yahoo!? > The all-new My Yahoo! - What will yours do? > http://my.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]