Re: Browser's refresh problem
Hi Hubert, Thanks for your reply first .. but: On Mon, Jul 12, 2004 at 09:32:45PM -0700, Hubert Rabago wrote: > This is really how it's designed to work. For a form to be resubmitted, the > user will have to regenerate the form, maybe by going back two pages, to the > page that was shown *before* the form. As you might already know, this > protects against accidental double submits. Yes, the problem is that even if the form is regenerated, it is STILL USING THE SAME REQUEST object, which means that the token still stays there. > If you're looking for an alternative, you can, instead of using tokens, use > redirects. This will not protect against double submits, but will allow the > same form to be resubmitted deliberately, while still protecting against > refresh operations. You could try manually removing the token, although I > think that will defeat the purpose of using them. Well, since we need to pass argument to the index page after user creation, so redirect doesn't seem to be possible Thank you again for your detailed reply! -- Layman <[EMAIL PROTECTED]> Ext: 8059 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Browser's refresh problem
This is really how it's designed to work. For a form to be resubmitted, the user will have to regenerate the form, maybe by going back two pages, to the page that was shown *before* the form. As you might already know, this protects against accidental double submits. If you're looking for an alternative, you can, instead of using tokens, use redirects. This will not protect against double submits, but will allow the same form to be resubmitted deliberately, while still protecting against refresh operations. You could try manually removing the token, although I think that will defeat the purpose of using them. Hubert --- Ding Lei <[EMAIL PROTECTED]> wrote: > Hi Craig, > I guess you misunderstood what I said. > The problem is that once the token is saved, even if I request the action > again(NOT "refresh") manually(by clicking some link on the page, or submit > a form), > the token is still there! and thus the action is never executed second > time. > Thanks. > > > > > On Mon, Jul 12, 2004 at 08:40:22PM -0700, Craig McClanahan wrote: > > Ding Lei wrote: > > > > >Hello ... > > > > > > > > >On Mon, Jul 12, 2004 at 10:50:46AM -0300, Guillermo Meyer wrote: > > > > > > > > >>Use Struts isTokenValid/saveToken schema in your addUsetToDatabase > > >>Action method. > > >> > > >> > > >the problem is that once it calls saveToken(), the damn token stays > > >there forever ... what's wrong with it? > > > > > > > > > > > I can see why you might be concerned (from a memory usage viewpoint) > > about the token staying there "forever" ... what I don't get is why that > > might be a functional concern? If you want to avoid double submits, > > you're going to check for the existence of the correct token value. > > Working backwards, that means your application logic *must* have called > > saveToken() prior to rendering the page with the input form you're > > checking -- but, since there's only one token, any previous value will > > at that point have been thrown away. Things still work correctly, > > though, in terms of what the token is designed to do -- you really can > > detect the second submit, and react differently to it. Right? > > > > By the way, even though there is no removeToken() method explicity > > available, you can always call: > > > > session.removeAttribute(Globals.TRANSACTION_TOKEN_KEY); > > > > if you really really want to get rid of it. > > > > Craig > > > > > > > > > > > > > > > > > > > > >>Cheers. > > >>Guillermo. > > >> > > >>-Original Message- > > >>From: Ding Lei [mailto:[EMAIL PROTECTED] > > >>Sent: Lunes, 12 de Julio de 2004 10:38 a.m. > > >>To: Struts Users Mailing List > > >>Subject: Browser's refresh problem > > >> > > >> > > >>Hi all, > > >> > > >> There's a UserAddAction, which adds the user record to the database, > > >>and when it's done it redirects the user index page. the problem is > that > > >>everytime the user clicks refresh at the user index page, the same > > >>record is added again. > > >> > > >> I know that unique check is required, but I also hopes that action > > >>itself should be aware of the user's "Refresh". > > >> > > >> Thank you. > > >> > > >> > > >>-- > > >>Layman <[EMAIL PROTECTED]> Ext: 8059 > > >> > > >>- > > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > > >>For additional commands, e-mail: [EMAIL PROTECTED] > > >> > > >>NOTA DE CONFIDENCIALIDAD > > >>Este mensaje (y sus anexos) es confidencial, esta dirigido > exclusivamente > > >>a las personas direccionadas en el mail y puede contener informacion > > >>(i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el > > >>secreto profesional. Cualquier opinion en el contenido, es exclusiva de > > > >>su autor y no representa necesariamente la opinion de Interbanking S.A. > > > >>El acceso no autorizado, uso, reproduccion, o divulgacion esta > prohibido. > > >>Interbanking S.A no asumira responsabilidad ni obligacion legal alguna > > >>por cualquier informacion incorrecta o alterada contenida en este > > >>mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga > la > > >>amabilidad de destruirlo inmediatamente junto con todas las copias del > > >>mismo, notificando al remitente. No debera utilizar, revelar, > distribuir, > > >>imprimir o copiar este mensaje ni ninguna de sus partes si usted no es > el > > >>destinatario. Muchas gracias. > > >> > > >> > > >> > > >>- > > >>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] > > -- > Layman <[EMAIL PROTECTED]> Ext: 8059Have an adequate day. > >
Re: logging
Hi, One can set priority for logging in case it affects application performance i.e., log only what's required, rest you can switch it off by setting log category to high (from WARN or ERROR ---> FATAL). We are into online booking engine and we have database of more than 70,000 customers and thousands of airline fares and other info accessed by approx. 200 users at a given point of time. Logging important info to a log file does not affect our app. Example # Roll - Logging into a file log4j.appender.Roll=org.apache.log4j.RollingFileAppender log4j.appender.Roll.File=${InstanceName}.log log4j.appender.Roll.MaxFileSize=10MB log4j.appender.Roll.MaxBackupIndex=100 log4j.appender.Roll.layout=org.apache.log4j.PatternLayout log4j.appender.Roll.layout.ConversionPattern=%x %d{.MM.dd HH:mm:ss,SSS} %5p [%t] (%c:%-4L %M) - %m%n ### # Class list with priority settings # ### # List of possible priorities: DEBUG, INFO, WARN, ERROR, FATAL # List of possible priorities: debug, info, warn, error, fatal # Framework1: DynamicResources log4j.category.ResResourceManager=FATAL log4j.category.ResApplication=ERROR log4j.category.ResTools=FATAL log4j.category.ResVisualComponent=FATAL log4j.category.ResPageContext=FATAL log4j.category.ResSessionR=ERROR . . # Framework2: ArnoldPpesentationLayer log4j.category.SideNavBarUser=ERROR log4j.category.FFareMainL=ERROR log4j.category.CATasksL=ERROR log4j.category.CADenyTask_DenyDetails=ERROR . . # Framework3: Core log4j.category.BaseApplication=INFO log4j.category.CoreApllication=INFO log4j.category.CoreBTBFareUtilities=ERROR log4j.category.CoreBTBUtility=FATAL . . # Application: Airside log4j.category.Application=INFO log4j.category.Session=INFO log4j.category.MainMenu=INFO log4j.category.PaymentDueReport=ERROR . . -Original Message- From: Shinobu Kawai [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 13, 2004 7:39 AM To: Struts Users Mailing List Subject: Re: logging Hi Ravi, > No ..no...its not an issue at all. > > Use it the way "Apurva" has mentioned. > > It works !! Yes, that would be one solution. I am providing another solution. It's just a matter of HOW. Which solution to pick is up to Viral. As for me, the main reason to use commons-logging is to decouple my application from the logging framework. Putting that in mind, Apurva's solution is far from my philosophy. BTW, Viral, you can just add a "%M" to your ConversionPattern and it will be replaced by the method name! But be sure to read the comment on http://logging.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html about performance issues. Best regards, -- Shinobu Kawai -- Shinobu Kawai <[EMAIL PROTECTED], [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: Browser's refresh problem
Hi Craig, I guess you misunderstood what I said. The problem is that once the token is saved, even if I request the action again(NOT "refresh") manually(by clicking some link on the page, or submit a form), the token is still there! and thus the action is never executed second time. Thanks. On Mon, Jul 12, 2004 at 08:40:22PM -0700, Craig McClanahan wrote: > Ding Lei wrote: > > >Hello ... > > > > > >On Mon, Jul 12, 2004 at 10:50:46AM -0300, Guillermo Meyer wrote: > > > > > >>Use Struts isTokenValid/saveToken schema in your addUsetToDatabase > >>Action method. > >> > >> > >the problem is that once it calls saveToken(), the damn token stays > >there forever ... what's wrong with it? > > > > > > > I can see why you might be concerned (from a memory usage viewpoint) > about the token staying there "forever" ... what I don't get is why that > might be a functional concern? If you want to avoid double submits, > you're going to check for the existence of the correct token value. > Working backwards, that means your application logic *must* have called > saveToken() prior to rendering the page with the input form you're > checking -- but, since there's only one token, any previous value will > at that point have been thrown away. Things still work correctly, > though, in terms of what the token is designed to do -- you really can > detect the second submit, and react differently to it. Right? > > By the way, even though there is no removeToken() method explicity > available, you can always call: > > session.removeAttribute(Globals.TRANSACTION_TOKEN_KEY); > > if you really really want to get rid of it. > > Craig > > > > > > > > > > > > >>Cheers. > >>Guillermo. > >> > >>-Original Message- > >>From: Ding Lei [mailto:[EMAIL PROTECTED] > >>Sent: Lunes, 12 de Julio de 2004 10:38 a.m. > >>To: Struts Users Mailing List > >>Subject: Browser's refresh problem > >> > >> > >>Hi all, > >> > >> There's a UserAddAction, which adds the user record to the database, > >>and when it's done it redirects the user index page. the problem is that > >>everytime the user clicks refresh at the user index page, the same > >>record is added again. > >> > >> I know that unique check is required, but I also hopes that action > >>itself should be aware of the user's "Refresh". > >> > >> Thank you. > >> > >> > >>-- > >>Layman <[EMAIL PROTECTED]> Ext: 8059 > >> > >>- > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > >>NOTA DE CONFIDENCIALIDAD > >>Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente > >>a las personas direccionadas en el mail y puede contener informacion > >>(i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el > >>secreto profesional. Cualquier opinion en el contenido, es exclusiva de > >>su autor y no representa necesariamente la opinion de Interbanking S.A. > >>El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. > >>Interbanking S.A no asumira responsabilidad ni obligacion legal alguna > >>por cualquier informacion incorrecta o alterada contenida en este > >>mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la > >>amabilidad de destruirlo inmediatamente junto con todas las copias del > >>mismo, notificando al remitente. No debera utilizar, revelar, distribuir, > >>imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el > >>destinatario. Muchas gracias. > >> > >> > >> > >>- > >>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] -- Layman <[EMAIL PROTECTED]> Ext: 8059Have an adequate day. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Browser's refresh problem
Ding Lei wrote: Hello ... On Mon, Jul 12, 2004 at 10:50:46AM -0300, Guillermo Meyer wrote: Use Struts isTokenValid/saveToken schema in your addUsetToDatabase Action method. the problem is that once it calls saveToken(), the damn token stays there forever ... what's wrong with it? I can see why you might be concerned (from a memory usage viewpoint) about the token staying there "forever" ... what I don't get is why that might be a functional concern? If you want to avoid double submits, you're going to check for the existence of the correct token value. Working backwards, that means your application logic *must* have called saveToken() prior to rendering the page with the input form you're checking -- but, since there's only one token, any previous value will at that point have been thrown away. Things still work correctly, though, in terms of what the token is designed to do -- you really can detect the second submit, and react differently to it. Right? By the way, even though there is no removeToken() method explicity available, you can always call: session.removeAttribute(Globals.TRANSACTION_TOKEN_KEY); if you really really want to get rid of it. Craig Cheers. Guillermo. -Original Message- From: Ding Lei [mailto:[EMAIL PROTECTED] Sent: Lunes, 12 de Julio de 2004 10:38 a.m. To: Struts Users Mailing List Subject: Browser's refresh problem Hi all, There's a UserAddAction, which adds the user record to the database, and when it's done it redirects the user index page. the problem is that everytime the user clicks refresh at the user index page, the same record is added again. I know that unique check is required, but I also hopes that action itself should be aware of the user's "Refresh". Thank you. -- Layman <[EMAIL PROTECTED]> Ext: 8059 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] NOTA DE CONFIDENCIALIDAD Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias. - 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: Browser's refresh problem
Hello ... On Mon, Jul 12, 2004 at 10:50:46AM -0300, Guillermo Meyer wrote: > Use Struts isTokenValid/saveToken schema in your addUsetToDatabase > Action method. the problem is that once it calls saveToken(), the damn token stays there forever ... what's wrong with it? > > Cheers. > Guillermo. > > -Original Message- > From: Ding Lei [mailto:[EMAIL PROTECTED] > Sent: Lunes, 12 de Julio de 2004 10:38 a.m. > To: Struts Users Mailing List > Subject: Browser's refresh problem > > > Hi all, > > There's a UserAddAction, which adds the user record to the database, > and when it's done it redirects the user index page. the problem is that > everytime the user clicks refresh at the user index page, the same > record is added again. > > I know that unique check is required, but I also hopes that action > itself should be aware of the user's "Refresh". > > Thank you. > > > -- > Layman <[EMAIL PROTECTED]> Ext: 8059 > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > NOTA DE CONFIDENCIALIDAD > Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las > personas direccionadas en el mail y puede contener informacion (i)de propiedad > exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier > opinion en el contenido, es exclusiva de su autor y no representa necesariamente la > opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o > divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni > obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en > este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la > amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, > notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar > este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias. > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Layman <[EMAIL PROTECTED]> Ext: 8059And so, men, we can see that human skin is an even more complex and fascinating organ than we thought it was, and if we want to keep it looking good, we have to care for it as though it were our own. One approach is to undergo a painful surgical procedure wherein your skin is turned inside-out, so the young cells are on the outside, but then of course you have the unpleasant side effect that your insides gradually fill up with dead old cells and you explode. So this procedure is pretty much limited to top Hollywood stars for whom youthful beauty is a career necessity, such as Elizabeth Taylor and Orson Welles. -- Dave Barry, "Saving Face" - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: webapp deployment
Make sure you have load-on-startup declared in web.xml! I had a problem with Struts not being loaded at all when I didn't have this declared, and the first request did not cause it to load either. Erik Phyl wrote: Hi, I've been developing a struts webapp using tomcat and am now trying to deploy it to my webserver. I copied every class and jsp manually since there is no .war deployment available on the server. Invoking a simple jsp directly works fine, however, when invoking a *struts' jsp* this exception is being thrown: javax.servlet.jsp.JspException: Cannot find global ActionForward for name welcome at org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:142) at org.apache.jsp.index$jsp._jspService(index$jsp.java:73) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) ... this is the associated .jsp: <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> It seems the "welcome" global forward isn't being found in struts-config, but I'm sure it exists. When calling an action directly I get a "Not Found" error. I'm beginning to doubt that struts-config.xml is even being loaded. What do you think might be the problem? thanks in advance, Phyl - 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: logging
Hi, One can set priority for logging in case it affects application performance i.e., log only what's required, rest you can switch it off by setting log category to high (from WARN or ERROR ---> FATAL). We are into online booking engine and we have database of more than 70,000 customers and thousands of airline fares and other info accessed by approx. 200 users at a given point of time. Logging important info to a log file does not affect our app. Example # Roll - Logging into a file log4j.appender.Roll=org.apache.log4j.RollingFileAppender log4j.appender.Roll.File=${InstanceName}.log log4j.appender.Roll.MaxFileSize=10MB log4j.appender.Roll.MaxBackupIndex=100 log4j.appender.Roll.layout=org.apache.log4j.PatternLayout log4j.appender.Roll.layout.ConversionPattern=%x %d{.MM.dd HH:mm:ss,SSS} %5p [%t] (%c:%-4L %M) - %m%n # Class list with priority settings # # List of possible priorities: DEBUG, INFO, WARN, ERROR, FATAL # List of possible priorities: debug, info, warn, error, fatal # Framework1: DynamicResources log4j.category.ResResourceManager=FATAL log4j.category.ResApplication=ERROR log4j.category.ResTools=FATAL log4j.category.ResVisualComponent=FATAL log4j.category.ResPageContext=FATAL log4j.category.ResSessionR=ERROR . . # Framework2: ArnoldPpesentationLayer log4j.category.SideNavBarUser=ERROR log4j.category.FFareMainL=ERROR log4j.category.CATasksL=ERROR log4j.category.CADenyTask_DenyDetails=ERROR . . # Framework3: Core log4j.category.BaseApplication=INFO log4j.category.CoreApllication=INFO log4j.category.CoreBTBFareUtilities=ERROR log4j.category.CoreBTBUtility=FATAL . . # Application: Airside log4j.category.Application=INFO log4j.category.Session=INFO log4j.category.MainMenu=INFO log4j.category.PaymentDueReport=ERROR . . -Original Message- From: Shinobu Kawai [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 13, 2004 7:39 AM To: Struts Users Mailing List Subject: Re: logging Hi Ravi, > No ..no...its not an issue at all. > > Use it the way "Apurva" has mentioned. > > It works !! Yes, that would be one solution. I am providing another solution. It's just a matter of HOW. Which solution to pick is up to Viral. As for me, the main reason to use commons-logging is to decouple my application from the logging framework. Putting that in mind, Apurva's solution is far from my philosophy. BTW, Viral, you can just add a "%M" to your ConversionPattern and it will be replaced by the method name! But be sure to read the comment on http://logging.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html about performance issues. Best regards, -- Shinobu Kawai -- Shinobu Kawai <[EMAIL PROTECTED], [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: webapp deployment
I am trying to figure out what serialization would have to do with the server? At 04:30 PM 7/12/2004, you wrote: > -Original Message- > From: Michael McGrady [mailto:[EMAIL PROTECTED] > Sent: Monday, July 12, 2004 4:25 PM > To: Struts Users Mailing List > Subject: RE: webapp deployment > > > If it will run a servlet, it will run struts. No? Something is tickling the back of my mind about Servlet spec versions. Could be cobwebs On the other hand, didn't struts have issues with an app server because of serialization issues? > > At 04:15 PM 7/12/2004, you wrote: > > > -Original Message- > > > From: Michael McGrady [mailto:[EMAIL PROTECTED] > > > Sent: Monday, July 12, 2004 4:12 PM > > > To: Struts Users Mailing List > > > Subject: Re: webapp deployment > > > > > > > > > Can you provide a bit more information and code? What do you > > > have for > > > global forwards in your struts-config.xml? Where is the > > > "welcome" forward > > > called? Etc. > > > >What web server? If it doesn't do .war deployments, is it > compliant enough to > >even run struts? > > > > > > > > At 04:08 PM 7/12/2004, you wrote: > > > > > > > Hi, > > > > > > > >I've been developing a struts webapp using tomcat and am now > > > trying to > > > >deploy it to my webserver. I copied every class and jsp > > > manually since > > > >there is no .war deployment available on the server. > > > >Invoking a simple jsp directly works fine, however, when > invoking a > > > >*struts' jsp* this exception is being thrown: > > > > > > > >javax.servlet.jsp.JspException: Cannot find global > > > ActionForward for name > > > >welcome > > > > at > > > > > > > org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag. > > > java:142) > > > > at org.apache.jsp.index$jsp._jspService(index$jsp.java:73) > > > > at > > > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) > > > > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > > > ... > > > > > > > >this is the associated .jsp: > > > > > > > ><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> > > > > > > > >It seems the "welcome" global forward isn't being found in > > > >struts-config, but I'm sure it exists. > > > >When calling an action directly I get a "Not Found" error. > > > I'm beginning > > > >to doubt that struts-config.xml is even being loaded. > > > >What do you think might be the problem? > > > > > > > > > > > >thanks in advance, > > > >Phyl > > > > > > > > > > > > > > > > > > > > > > > > > > > > >- > > > >To unsubscribe, e-mail: [EMAIL PROTECTED] > > > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logging
Hi Ravi, > No ..no...its not an issue at all. > > Use it the way "Apurva" has mentioned. > > It works !! Yes, that would be one solution. I am providing another solution. It's just a matter of HOW. Which solution to pick is up to Viral. As for me, the main reason to use commons-logging is to decouple my application from the logging framework. Putting that in mind, Apurva's solution is far from my philosophy. BTW, Viral, you can just add a "%M" to your ConversionPattern and it will be replaced by the method name! But be sure to read the comment on http://logging.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html about performance issues. Best regards, -- Shinobu Kawai -- Shinobu Kawai <[EMAIL PROTECTED], [EMAIL PROTECTED]> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: webapp deployment
Are you using Tomcat in-process with the apache server on an AS/400? Your problem, and the fact you don't have .war deployment sound familar. John Thompson [EMAIL PROTECTED] |-+> | | Phyl | | | <[EMAIL PROTECTED]| | | net> | | || | | 13/07/2004 11:08 | | | AM | | | Please respond to| | | "Struts Users| | | Mailing List"| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: webapp deployment | >--| Hi, I've been developing a struts webapp using tomcat and am now trying to deploy it to my webserver. I copied every class and jsp manually since there is no .war deployment available on the server. Invoking a simple jsp directly works fine, however, when invoking a *struts' jsp* this exception is being thrown: javax.servlet.jsp.JspException: Cannot find global ActionForward for name welcome at org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:142) at org.apache.jsp.index$jsp._jspService(index$jsp.java:73) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) ... this is the associated .jsp: <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> It seems the "welcome" global forward isn't being found in struts-config, but I'm sure it exists. When calling an action directly I get a "Not Found" error. I'm beginning to doubt that struts-config.xml is even being loaded. What do you think might be the problem? thanks in advance, Phyl - 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: logging
Hi Viral, Yeah looks like pattern difference, the ConversionPattern I am using for logging to a file is : log4j.appender.Roll.layout.ConversionPattern=%x %d{.MM.dd HH:mm:ss,SSS} %5p [%t] (%c:%-4L %M) - %m%n Here is the complete prop file # # Log4J Properties # # Developer Settings # log4j.rootCategory=debug, stdout, Roll # Deployment Settings log4j.rootCategory=info, Roll # stdout - Logging onto the console #log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout=org.apache.log4j.FileAppender log4j.appender.stdout.File=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%x %d{HH:mm:ss,SSS} %5p [%t] (%c:%-4L %M) - %m%n # Roll - Logging into a file log4j.appender.Roll=org.apache.log4j.RollingFileAppender log4j.appender.Roll.File=${InstanceName}.log log4j.appender.Roll.MaxFileSize=10MB log4j.appender.Roll.MaxBackupIndex=100 log4j.appender.Roll.layout=org.apache.log4j.PatternLayout log4j.appender.Roll.layout.ConversionPattern=%x %d{.MM.dd HH:mm:ss,SSS} %5p [%t] (%c:%-4L %M) - %m%n # Framework: core log4j.category.CoreLog=INFO log4j.category.CoreBTBUtility=INFO log4j.category.CoreFareMainL=FATAL Hope this helps Cheers Apurva Goswami Release Manager ARNOLD Travel Technology Pty Limited 685 South Dowling Street, Surry Hills, NSW 2016, Australia Direct telephone: 61 2 9318-8142 -Original Message- From: Viral_Thakkar [mailto:[EMAIL PROTECTED] Sent: Monday, July 12, 2004 11:36 PM To: Struts Users Mailing List Subject: RE: logging Hi Apurva, We are having a class level variable as you mentioned as below org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(ResResourceManager.class.getName() ); I think the difference will be in the log4j.appender.R.layout.ConversionPattern=%d, [%t], %-5p, %c, - %m%n in log4jconfig.properties file. Could you please let me know log4j.appender.R.layout.ConversionPattern value ..?? Thanks, Viral -Original Message- From: Apurva Goswami [mailto:[EMAIL PROTECTED] Sent: Monday, July 12, 2004 11:50 AM To: 'Struts Users Mailing List' Subject: RE: logging Try Put these lines on top of your class file // Log4j // Log4j with Try-Catch: try {...} catch (Exception e) { cat.error(e, e); } static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance("File Name".class.getName()); E.g. static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(ResResourceManager.class.getName() ); Use these methods as per your requirement cat.debug() - > cat.debug("", e); cat.error() - > cat.error("", e); cat.fatal() - > cat.fatal("", e); It prints the method name in the log and you do not need to pass. E.g. if I use statement : if (cat.isDebugEnabled()) cat.debug("Retrieved " + agencyDepPortsDropDownList.count() + " " + countrycode + " Ports"); I get this in my log file : (CoreFareMainL:3515 initAgencyDepPortsDropDownList) - Retrieved 117 AU Ports (Class file: linenumber method ) - string message Hope it helps Cheers Apurva -Original Message- From: Viral_Thakkar [mailto:[EMAIL PROTECTED] Sent: Monday, July 12, 2004 4:03 PM To: Struts Users Mailing List Subject: logging Hi All, I am using commons-logging (using log4j) for logging.. We do following logging style... if (logger.isDebugEnabled()) { logger.debug("Method Name : + some Message"); } Here can we get the method name using java reflection or some other way so that no need to pass the method name while logging the message ..??? Regards, Viral - 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: webapp deployment
> -Original Message- > From: Michael McGrady [mailto:[EMAIL PROTECTED] > Sent: Monday, July 12, 2004 4:25 PM > To: Struts Users Mailing List > Subject: RE: webapp deployment > > > If it will run a servlet, it will run struts. No? Something is tickling the back of my mind about Servlet spec versions. Could be cobwebs On the other hand, didn't struts have issues with an app server because of serialization issues? > > At 04:15 PM 7/12/2004, you wrote: > > > -Original Message- > > > From: Michael McGrady [mailto:[EMAIL PROTECTED] > > > Sent: Monday, July 12, 2004 4:12 PM > > > To: Struts Users Mailing List > > > Subject: Re: webapp deployment > > > > > > > > > Can you provide a bit more information and code? What do you > > > have for > > > global forwards in your struts-config.xml? Where is the > > > "welcome" forward > > > called? Etc. > > > >What web server? If it doesn't do .war deployments, is it > compliant enough to > >even run struts? > > > > > > > > At 04:08 PM 7/12/2004, you wrote: > > > > > > > Hi, > > > > > > > >I've been developing a struts webapp using tomcat and am now > > > trying to > > > >deploy it to my webserver. I copied every class and jsp > > > manually since > > > >there is no .war deployment available on the server. > > > >Invoking a simple jsp directly works fine, however, when > invoking a > > > >*struts' jsp* this exception is being thrown: > > > > > > > >javax.servlet.jsp.JspException: Cannot find global > > > ActionForward for name > > > >welcome > > > > at > > > > > > > org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag. > > > java:142) > > > > at org.apache.jsp.index$jsp._jspService(index$jsp.java:73) > > > > at > > > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) > > > > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > > > ... > > > > > > > >this is the associated .jsp: > > > > > > > ><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> > > > > > > > >It seems the "welcome" global forward isn't being found in > > > >struts-config, but I'm sure it exists. > > > >When calling an action directly I get a "Not Found" error. > > > I'm beginning > > > >to doubt that struts-config.xml is even being loaded. > > > >What do you think might be the problem? > > > > > > > > > > > >thanks in advance, > > > >Phyl > > > > > > > > > > > > > > > > > > > > > > > > > > > > >- > > > >To unsubscribe, e-mail: [EMAIL PROTECTED] > > > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: webapp deployment
If it will run a servlet, it will run struts. No? At 04:15 PM 7/12/2004, you wrote: > -Original Message- > From: Michael McGrady [mailto:[EMAIL PROTECTED] > Sent: Monday, July 12, 2004 4:12 PM > To: Struts Users Mailing List > Subject: Re: webapp deployment > > > Can you provide a bit more information and code? What do you > have for > global forwards in your struts-config.xml? Where is the > "welcome" forward > called? Etc. What web server? If it doesn't do .war deployments, is it compliant enough to even run struts? > > At 04:08 PM 7/12/2004, you wrote: > > > Hi, > > > >I've been developing a struts webapp using tomcat and am now > trying to > >deploy it to my webserver. I copied every class and jsp > manually since > >there is no .war deployment available on the server. > >Invoking a simple jsp directly works fine, however, when invoking a > >*struts' jsp* this exception is being thrown: > > > >javax.servlet.jsp.JspException: Cannot find global > ActionForward for name > >welcome > > at > > > org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag. > java:142) > > at org.apache.jsp.index$jsp._jspService(index$jsp.java:73) > > at > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > ... > > > >this is the associated .jsp: > > > ><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> > > > >It seems the "welcome" global forward isn't being found in > >struts-config, but I'm sure it exists. > >When calling an action directly I get a "Not Found" error. > I'm beginning > >to doubt that struts-config.xml is even being loaded. > >What do you think might be the problem? > > > > > >thanks in advance, > >Phyl > > > > > > > > > > > > > >- > >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: webapp deployment
> -Original Message- > From: Michael McGrady [mailto:[EMAIL PROTECTED] > Sent: Monday, July 12, 2004 4:12 PM > To: Struts Users Mailing List > Subject: Re: webapp deployment > > > Can you provide a bit more information and code? What do you > have for > global forwards in your struts-config.xml? Where is the > "welcome" forward > called? Etc. What web server? If it doesn't do .war deployments, is it compliant enough to even run struts? > > At 04:08 PM 7/12/2004, you wrote: > > > Hi, > > > >I've been developing a struts webapp using tomcat and am now > trying to > >deploy it to my webserver. I copied every class and jsp > manually since > >there is no .war deployment available on the server. > >Invoking a simple jsp directly works fine, however, when invoking a > >*struts' jsp* this exception is being thrown: > > > >javax.servlet.jsp.JspException: Cannot find global > ActionForward for name > >welcome > > at > > > org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag. > java:142) > > at org.apache.jsp.index$jsp._jspService(index$jsp.java:73) > > at > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > ... > > > >this is the associated .jsp: > > > ><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> > > > >It seems the "welcome" global forward isn't being found in > >struts-config, but I'm sure it exists. > >When calling an action directly I get a "Not Found" error. > I'm beginning > >to doubt that struts-config.xml is even being loaded. > >What do you think might be the problem? > > > > > >thanks in advance, > >Phyl > > > > > > > > > > > > > >- > >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: webapp deployment
Can you provide a bit more information and code? What do you have for global forwards in your struts-config.xml? Where is the "welcome" forward called? Etc. At 04:08 PM 7/12/2004, you wrote: Hi, I've been developing a struts webapp using tomcat and am now trying to deploy it to my webserver. I copied every class and jsp manually since there is no .war deployment available on the server. Invoking a simple jsp directly works fine, however, when invoking a *struts' jsp* this exception is being thrown: javax.servlet.jsp.JspException: Cannot find global ActionForward for name welcome at org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:142) at org.apache.jsp.index$jsp._jspService(index$jsp.java:73) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) ... this is the associated .jsp: <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> It seems the "welcome" global forward isn't being found in struts-config, but I'm sure it exists. When calling an action directly I get a "Not Found" error. I'm beginning to doubt that struts-config.xml is even being loaded. What do you think might be the problem? thanks in advance, Phyl - 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]
webapp deployment
Hi, I've been developing a struts webapp using tomcat and am now trying to deploy it to my webserver. I copied every class and jsp manually since there is no .war deployment available on the server. Invoking a simple jsp directly works fine, however, when invoking a *struts' jsp* this exception is being thrown: javax.servlet.jsp.JspException: Cannot find global ActionForward for name welcome at org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:142) at org.apache.jsp.index$jsp._jspService(index$jsp.java:73) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) ... this is the associated .jsp: <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> It seems the "welcome" global forward isn't being found in struts-config, but I'm sure it exists. When calling an action directly I get a "Not Found" error. I'm beginning to doubt that struts-config.xml is even being loaded. What do you think might be the problem? thanks in advance, Phyl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms
Yes, I think that's a great improvement. Still, I feel like Struts should be responsible for managing the scopes and the placement of the form bean into the correct scope. Also, and this may just be because I got on the "view controller" horse a long time ago, but I feel like there should be a config file that knows the name and scope of the form bean, and it should be hooked to the forward config, and not hard-coded into the action. Am I just being too much of a formalist? Joe At 10:09 PM +0100 7/12/04, Niall Pemberton wrote: Do you not think that the new standard mechanism in Struts 1.2.1 for creating ActionForms (regular or Dyna) makes this more straight forward? public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Excetpion { // Find the FormBeanConfig FormBeanConfig config = mapping.getModuleConfig().findFormBeanConfig("myForm"); // Create new ActionForm ActionForm newForm = config.createActionForm(servlet); } -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place." - Carlos Santana - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms & validation
Apologies Erik, its not in this version...maybe the next one. Niall - Original Message - From: "Erik Weber" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, July 12, 2004 10:44 PM Subject: Re: Prepopulating forms & validation > Awesome! Inheritance in, or parameterizing of, the Validator plugin, > will be the last step in getting a CRU (no D) use case finished the > *right* way (hopefully). This is with declarative validation, > declarative exception handling, an action layer, a business layer and a > data access layer (architect demanded these layers), as well as full use > of Struts HTML tags for all forms, and some use of bean and logic tags, > plus I wrote a PlugIn for combo box value arrays and a pluggable > validator extension to do some "twofields" matching, and finally learned > how to do conditional validation with requiredif. Oh, and of course the > "static" content is all pulled from i18n-able properties files. Total > time to learn Struts from scratch, set up JBoss, MySQL, CVS and get this > use case working: Three weeks. > > Not too shabby eh? I'm sold on Struts, but the docs need to be revised, > revised and revised some more! Maybe someday I'll have time to contribute. > > The only thing I have done redundantly is check for "loggedin-ness", but > I will soon refactor that with a Servlet filter methinks. > > Thanks to all on this list who have helped! Can't wait till the clients > ask for the site in Spanish! > > Erik > > - > 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: Prepopulating forms & validation
Sorry, you're right its not in this version - I've been living under that misconception for weeks now. Niall - Original Message - From: "Hubert Rabago" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, July 12, 2004 10:33 PM Subject: Re: Prepopulating forms & validation > I wanted to ask about this. The javadoc of Validator's Form.inherit field ( > http://jakarta.apache.org/commons/validator/apidocs/org/apache/commons/validator/Form.html#inherit > ) has it marked as "Since Validator 1.2.0", so I was thinking the inheritance > feature wasn't included yet. Do you know if this is the case? > > Hubert > > --- Niall Pemberton <[EMAIL PROTECTED]> wrote: > > The version of commons validator (1.1.3 I think) that comes with the > > recently released Sruts 1.2.1 beta allows you to inherit from another form > > definition using the extends attribute > > > > Niall > > > > - Original Message - > > From: "Erik Weber" <[EMAIL PROTECTED]> > > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > > Sent: Monday, July 12, 2004 10:09 PM > > Subject: Re: Prepopulating forms & validation > > > > > > > Thanks a lot! I no doubt will find that very useful. > > > > > > I have another question for the group at large: > > > > > > I am now using the same form successfully for adds and updates. I am > > > using the Validator plugin for validation, which I find to be pretty > > > awesome. The problem I face though is, the fields I need to validate are > > > slightly different between add and update conditions. > > > > > > For example, when I add, there is a "disclaimer" checkbox that *must* be > > > checked. When I update, there is no longer any checkbox. I am trying to > > > share the element in validation.xml, obviously, because the form > > > itself is (almost) the same. So the problem is that sometimes I need > > > "required", and sometimes not, for this checkbox field. > > > > > > Because of one or two fields being different between add and update > > > forms, I fear I'll have to do a nearly-redundant (and very long) > > > element for my update condition in validation.xml. Does anyone have a > > > better solution? > > > > > > Thanks, > > > Erik > > > > > > > > > > > > Rick Reumann wrote: > > > > > > > On Mon, 12 Jul 2004 12:22:11 -0400, Erik Weber > > > > <[EMAIL PROTECTED]> wrote: > > > > > > > >> Using BeanUtils.copyProperties(), it's a piece of cake to update > > > >> your Form bean from the ValueObject properties. > > > >> > > > >> Do you have an example of this, or is there one on your site? I > > > >> indeed have some properties that are the same between form bean and > > > >> VO, but some are not (for example my form beans use only Strings, > > > >> but my VOs use some booleans, ints, etc.) > > > > > > > > > > > > Sorry was busy so unable to keep up with this thread. > > > > > > > > No, the types can all be different. BeanUtils will convert them for > > > > you, so your formBean can have all Strings (some would argue it > > > > should only be all Strings anyway) and your VO obviously will have > > > > different types. To copy the properties from your VO to your form > > > > bean it's as simple as: > > > > > > > > import org.apache.commons.beanutils.BeanUtils; > > > > > > > > BeanUtils.copyProperties(youFormBean, yourVO); > > > > > > > > If you are dealing with java.util.Dates you'll have one other thing to > > > > do (register a converter for your app) but I can explain that more if > > > > you need to go that route. > > > > > > > > > > - > > > 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!? > Yahoo! Mail is new and improved - Check it out! > http://promotions.yahoo.com/new_mail > > - > 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: Prepopulating forms & validation
Awesome! Inheritance in, or parameterizing of, the Validator plugin, will be the last step in getting a CRU (no D) use case finished the *right* way (hopefully). This is with declarative validation, declarative exception handling, an action layer, a business layer and a data access layer (architect demanded these layers), as well as full use of Struts HTML tags for all forms, and some use of bean and logic tags, plus I wrote a PlugIn for combo box value arrays and a pluggable validator extension to do some "twofields" matching, and finally learned how to do conditional validation with requiredif. Oh, and of course the "static" content is all pulled from i18n-able properties files. Total time to learn Struts from scratch, set up JBoss, MySQL, CVS and get this use case working: Three weeks. Not too shabby eh? I'm sold on Struts, but the docs need to be revised, revised and revised some more! Maybe someday I'll have time to contribute. The only thing I have done redundantly is check for "loggedin-ness", but I will soon refactor that with a Servlet filter methinks. Thanks to all on this list who have helped! Can't wait till the clients ask for the site in Spanish! Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms & validation
I wanted to ask about this. The javadoc of Validator's Form.inherit field ( http://jakarta.apache.org/commons/validator/apidocs/org/apache/commons/validator/Form.html#inherit ) has it marked as "Since Validator 1.2.0", so I was thinking the inheritance feature wasn't included yet. Do you know if this is the case? Hubert --- Niall Pemberton <[EMAIL PROTECTED]> wrote: > The version of commons validator (1.1.3 I think) that comes with the > recently released Sruts 1.2.1 beta allows you to inherit from another form > definition using the extends attribute > > Niall > > - Original Message - > From: "Erik Weber" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > Sent: Monday, July 12, 2004 10:09 PM > Subject: Re: Prepopulating forms & validation > > > > Thanks a lot! I no doubt will find that very useful. > > > > I have another question for the group at large: > > > > I am now using the same form successfully for adds and updates. I am > > using the Validator plugin for validation, which I find to be pretty > > awesome. The problem I face though is, the fields I need to validate are > > slightly different between add and update conditions. > > > > For example, when I add, there is a "disclaimer" checkbox that *must* be > > checked. When I update, there is no longer any checkbox. I am trying to > > share the element in validation.xml, obviously, because the form > > itself is (almost) the same. So the problem is that sometimes I need > > "required", and sometimes not, for this checkbox field. > > > > Because of one or two fields being different between add and update > > forms, I fear I'll have to do a nearly-redundant (and very long) > > element for my update condition in validation.xml. Does anyone have a > > better solution? > > > > Thanks, > > Erik > > > > > > > > Rick Reumann wrote: > > > > > On Mon, 12 Jul 2004 12:22:11 -0400, Erik Weber > > > <[EMAIL PROTECTED]> wrote: > > > > > >> Using BeanUtils.copyProperties(), it's a piece of cake to update > > >> your Form bean from the ValueObject properties. > > >> > > >> Do you have an example of this, or is there one on your site? I > > >> indeed have some properties that are the same between form bean and > > >> VO, but some are not (for example my form beans use only Strings, > > >> but my VOs use some booleans, ints, etc.) > > > > > > > > > Sorry was busy so unable to keep up with this thread. > > > > > > No, the types can all be different. BeanUtils will convert them for > > > you, so your formBean can have all Strings (some would argue it > > > should only be all Strings anyway) and your VO obviously will have > > > different types. To copy the properties from your VO to your form > > > bean it's as simple as: > > > > > > import org.apache.commons.beanutils.BeanUtils; > > > > > > BeanUtils.copyProperties(youFormBean, yourVO); > > > > > > If you are dealing with java.util.Dates you'll have one other thing to > > > do (register a converter for your app) but I can explain that more if > > > you need to go that route. > > > > > > > - > > 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!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms & validation
On Mon, 12 Jul 2004 17:09:41 -0400, Erik Weber <[EMAIL PROTECTED]> wrote: Because of one or two fields being different between add and update forms, I fear I'll have to do a nearly-redundant (and very long) element for my update condition in validation.xml. Does anyone have a better solution? Oh sorry I replied to soon. Yea this is a problem. I suggested a long time ago that you should be able to 'extend' other validation xml definitions. Not sure if that was ever worked on by anyone or not, but that would be nice. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms & validation
The version of commons validator (1.1.3 I think) that comes with the recently released Sruts 1.2.1 beta allows you to inherit from another form definition using the extends attribute Niall - Original Message - From: "Erik Weber" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, July 12, 2004 10:09 PM Subject: Re: Prepopulating forms & validation > Thanks a lot! I no doubt will find that very useful. > > I have another question for the group at large: > > I am now using the same form successfully for adds and updates. I am > using the Validator plugin for validation, which I find to be pretty > awesome. The problem I face though is, the fields I need to validate are > slightly different between add and update conditions. > > For example, when I add, there is a "disclaimer" checkbox that *must* be > checked. When I update, there is no longer any checkbox. I am trying to > share the element in validation.xml, obviously, because the form > itself is (almost) the same. So the problem is that sometimes I need > "required", and sometimes not, for this checkbox field. > > Because of one or two fields being different between add and update > forms, I fear I'll have to do a nearly-redundant (and very long) > element for my update condition in validation.xml. Does anyone have a > better solution? > > Thanks, > Erik > > > > Rick Reumann wrote: > > > On Mon, 12 Jul 2004 12:22:11 -0400, Erik Weber > > <[EMAIL PROTECTED]> wrote: > > > >> Using BeanUtils.copyProperties(), it's a piece of cake to update > >> your Form bean from the ValueObject properties. > >> > >> Do you have an example of this, or is there one on your site? I > >> indeed have some properties that are the same between form bean and > >> VO, but some are not (for example my form beans use only Strings, > >> but my VOs use some booleans, ints, etc.) > > > > > > Sorry was busy so unable to keep up with this thread. > > > > No, the types can all be different. BeanUtils will convert them for > > you, so your formBean can have all Strings (some would argue it > > should only be all Strings anyway) and your VO obviously will have > > different types. To copy the properties from your VO to your form > > bean it's as simple as: > > > > import org.apache.commons.beanutils.BeanUtils; > > > > BeanUtils.copyProperties(youFormBean, yourVO); > > > > If you are dealing with java.util.Dates you'll have one other thing to > > do (register a converter for your app) but I can explain that more if > > you need to go that route. > > > > - > 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: Prepopulating forms & validation
On Mon, 12 Jul 2004 17:09:41 -0400, Erik Weber <[EMAIL PROTECTED]> wrote: I am now using the same form successfully for adds and updates. I am using the Validator plugin for validation, which I find to be pretty awesome. The problem I face though is, the fields I need to validate are slightly different between add and update conditions. Use the ValidatorActionForm and validate on the Action name, not the form name. Useful for just that reasons you've desscribed. You can have different validation set up for the updateAction vs the insertAction. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms
On Mon, 12 Jul 2004 22:09:15 +0100, Niall Pemberton <[EMAIL PROTECTED]> wrote: // Find the FormBeanConfig FormBeanConfig config = mapping.getModuleConfig().findFormBeanConfig("myForm"); I've only rarely ever had to create Forms in my Actions (like you're doing in the above). I'd be curious about cases when you would ever need to do this? The only time that I see having to do this is when you plan to actually nest ActionForms within ActionForms (and thus have to build some in order to nest them), which in that case I wouldn't even bother nesting ActionForms and would just use the VO and nest that. Validation has to be done more manually, but no big deal. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: R: Prepopulating forms
On Mon, 12 Jul 2004 13:02:21 -0400, Erik Weber <[EMAIL PROTECTED]> wrote: I recall that when I set the "value" property on any of my inputs, I ran into a problem with user input changes being "remembered" in the case of a page reload due to form validation failure. This depends Erik. If you are harcoding it like: //!NOT GOOD //ok, but silly The later should be ok, but would be a waste since the html tag will take care of setting the value for you when you use 'property.' -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to read from web.xml?
Ivan Vasquez wrote: Hi, How can I read from web.xml, say, the application's display name? I've tried several things, but no luck. This isn't really Struts-specific, but I'm sure this is an easy one for many of you. Thanks, Ivan. in an struts action you should be able to use: getServlet().getServletContext().getServletContextName() from javadocs: javax.servlet.ServletContext.getServletContextName() Returns the name of this web application correponding to this ServletContext as specified in the deployment descriptor for this web application by the display-name element. (haven't tried this myself though) -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms & validation
Thanks a lot! I no doubt will find that very useful. I have another question for the group at large: I am now using the same form successfully for adds and updates. I am using the Validator plugin for validation, which I find to be pretty awesome. The problem I face though is, the fields I need to validate are slightly different between add and update conditions. For example, when I add, there is a "disclaimer" checkbox that *must* be checked. When I update, there is no longer any checkbox. I am trying to share the element in validation.xml, obviously, because the form itself is (almost) the same. So the problem is that sometimes I need "required", and sometimes not, for this checkbox field. Because of one or two fields being different between add and update forms, I fear I'll have to do a nearly-redundant (and very long) element for my update condition in validation.xml. Does anyone have a better solution? Thanks, Erik Rick Reumann wrote: On Mon, 12 Jul 2004 12:22:11 -0400, Erik Weber <[EMAIL PROTECTED]> wrote: Using BeanUtils.copyProperties(), it's a piece of cake to update your Form bean from the ValueObject properties. Do you have an example of this, or is there one on your site? I indeed have some properties that are the same between form bean and VO, but some are not (for example my form beans use only Strings, but my VOs use some booleans, ints, etc.) Sorry was busy so unable to keep up with this thread. No, the types can all be different. BeanUtils will convert them for you, so your formBean can have all Strings (some would argue it should only be all Strings anyway) and your VO obviously will have different types. To copy the properties from your VO to your form bean it's as simple as: import org.apache.commons.beanutils.BeanUtils; BeanUtils.copyProperties(youFormBean, yourVO); If you are dealing with java.util.Dates you'll have one other thing to do (register a converter for your app) but I can explain that more if you need to go that route. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to read from web.xml?
Ivan Vasquez wrote: Hi, How can I read from web.xml, say, the application's display name? I've tried several things, but no luck. This isn't really Struts-specific, but I'm sure this is an easy one for many of you. Thanks, Ivan. The web.xml file is available as a resource that can be accessed via the ServletContext for your webapp. For example, you can say something like: ServletContext context = ...; // Get a reference to our servlet context InputStream stream = context.getResourceAsStream("/WEB-INF/web.xml"); Now you've got an input stream to read the contents ... you'll probably want to use an XML parser to parse the contents -- google for JAXP to see the API that Java provides for this purpose. Or, you might consider using the Commons Digester package (included with Struts), which is what Struts itself uses to parse this very resource, in order to figure out how the controller servlet is mapped. Looking at the source code for ActionServlet should give you some useful clues. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms
Joe, Do you not think that the new standard mechanism in Struts 1.2.1 for creating ActionForms (regular or Dyna) makes this more straight forward? public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Excetpion { // Find the FormBeanConfig FormBeanConfig config = mapping.getModuleConfig().findFormBeanConfig("myForm"); // Create new ActionForm ActionForm newForm = config.createActionForm(servlet); } Niall - Original Message - Joe Germuska wrote .. > If your form bean is a simple non-dynamic form, then it's not too big > a deal to instantiate the bean, populate it, and put it in request or > session scope under the "name" attribute associated with the action > which receives the form submission. This is the bare minimum to do > to "make it work." If you're using DynaForms, it's a little harder > to get an instance. > > In the Struts 1.3 timeline, I'm hoping to work on some things to make > this easier. If you are interested in the details and in being on > the "bleeding edge," feel free to subscribe to the [EMAIL PROTECTED] list > where this would be discussed/critiqued/etc. I can't use the pending > release of 1.2.1 as an excuse any more, so now I just have to squeeze > time into my schedule to get started. > > Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms
On Mon, 12 Jul 2004 12:22:11 -0400, Erik Weber <[EMAIL PROTECTED]> wrote: Using BeanUtils.copyProperties(), it's a piece of cake to update your Form bean from the ValueObject properties. Do you have an example of this, or is there one on your site? I indeed have some properties that are the same between form bean and VO, but some are not (for example my form beans use only Strings, but my VOs use some booleans, ints, etc.) Sorry was busy so unable to keep up with this thread. No, the types can all be different. BeanUtils will convert them for you, so your formBean can have all Strings (some would argue it should only be all Strings anyway) and your VO obviously will have different types. To copy the properties from your VO to your form bean it's as simple as: import org.apache.commons.beanutils.BeanUtils; BeanUtils.copyProperties(youFormBean, yourVO); If you are dealing with java.util.Dates you'll have one other thing to do (register a converter for your app) but I can explain that more if you need to go that route. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles and Oracle ADF in JDeveloper10g
Thanks Duncan! Assigning a tiles definition to the parameter attribute of the action worked. Excellent - thanks again! -Original Message- From: Duncan Mills [mailto:[EMAIL PROTECTED] Sent: Monday, July 12, 2004 11:51 AM To: Struts Users Mailing List Subject: Re: Tiles and Oracle ADF in JDeveloper10g John, If you are using a DataPage (e.g. oracle.adf.controller.struts.actions.DataForwardAction) then the parameter attribute on the Action mapping takes the page that needs to be displayed once the data binding has been processed. That parameter attribute can take a tiles definition without a problem and that being the case, as long as the tag points back to the DataPage all should be OK - I've just tried it here and it works without a hitch. Are you trying to use a DataPage as an individual tile, within a layout? That would perhaps cause what you are seeing. If that's the case then tweek it so that DataPage points to the tiles def as a while rather than the bound JSP and run the DataPage. Regards Duncan Mills http://www.groundside.com/blog Ruffin, John wrote: >The basic question is: > >If using Tiles in an application that uses ADF, how do you change the action >of lets say - a submit button on an input form - to return the a components >defined in a tiles-def definition? > >The ADF submit button returns the component where the submit button lives - >thus losing the other tiles on the page. > > > >The information in this email is confidential and may be >legally privileged. It is intended solely for the addressee, >and access by anyone else is unauthorized. > >If you are not the intended recipient, any disclosure, >copying, distribution or any action taken or omitted to be >taken in reliance on it, is prohibited and may be unlawful. > >If you believe that you have received this email in error, >please advise us by calling (901) 385 3688, or emailing >[EMAIL PROTECTED], and then delete this message >and all copies and backups thereof. Thank you. > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- - 3 - The information in this email is confidential and may be legally privileged. It is intended solely for the addressee, and access by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. If you believe that you have received this email in error, please advise us by calling (901) 385 3688, or emailing [EMAIL PROTECTED], and then delete this message and all copies and backups thereof. Thank you.
RE: Checkboxes
> -Original Message- > From: simon_delaroute [mailto:[EMAIL PROTECTED] > Sent: Sunday, July 11, 2004 7:46 PM > To: [EMAIL PROTECTED] > Subject: Checkboxes > > > Hi > I am using struts and want to display a list of options for the user > to select with checkboxes using the struts-el tags. The information > on each option is stored in an object, name, age height weight and > each of these objects is stored in an ArrayList called people which > is placed in the session. Name of object person name of ArrayList > people. > > I want the information to be displayed as a table(using a loop) each > row holding the information on a different person with check boxes at > the end of each row. The user can check as many as they want. > I can get the people ArrayList from the session scope but don't know > how to access the person objects within it or how display the data > with in each person object > . I have played around with it for a long time but have not had any > success. Thanks for any help. Documentation says: logic:iterate id The name of a page scope JSP bean that will contain the current element of the collection on each iteration, if it is not null. So this should iterate through the collection And I want to display a bean. so let's see what the bean taglib has. ooo bean:write. Name: Specifies the attribute name of the bean whose property is accessed to retrieve the value specified by property (if specified). If property is not specified, the value of this bean itself will be rendered. Property: Specifies the name of the property to be accessed on the bean specified by name. This value may be a simple, indexed, or nested property reference expression. If not specified, the bean identified by name will itself be rendered. If the specified property returns null, no output will be rendered So all together As for the checkboxes you might want to do something likes this: http://www.husted.com/struts/tips/007.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: R: Prepopulating forms
At 6:33 PM +0200 7/12/04, Amleto Di Salle wrote: Hi all, you can use the action in order to obtain the VO. But a question: Are you using the html tags inside your jsp? If yes, you can put the VO in the request and use the "value" (for example value="${requestScope.anObject.aProperty}") attribute in the html tags (for example "html:text). I would like to appreciate some comments in order to use this solution. This works, in a sense, but then overrides the ability of the html:* tags to re-present user-entered data in the case of server-side validation errors. It's generally considered better for usability if you present exactly the data the user entered when returning them to a form page because of validation errors. This is also why it's generally advised to make your free-text-entry form bean properties of type String even if you want the user to enter a number. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place." - Carlos Santana - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms
Joe and Wendy, thanks for all your help. Hearing the practical advice and the theoretical advice gives me a plan for getting things done but also keeps me thinking toward the best way of doing things! I think what you are saying here will dawn on me more as I get deeper into development, and I have a feeling I'll need to revisit the caveats you have highlighted here. So I appreciate it. Have a great day! Erik Joe Germuska wrote: At 12:16 PM -0400 7/12/04, Erik Weber wrote: Joe, thanks for your opinion. You and Rick have convinced me to stay with one form page for add/update. I did this before in a non-struts app, and despite all the conditionals I ended up with, the ensuing layout revisions did make it worth it. So, Joe, I am not using Dyna Forms, just plain old form beans. (I may refactor my DTOs/VOs and form beans into some base class because of all the shared fields, but for now, I'm getting a lot of use out of a bean generator I wrote). Are you agreeing then, that the best approach (currently) is to create an action for the view screen (in this case, the "update" form page), and in that action, obtain a VO and use the values from that to set the properties of the ActionForm? You are saying if I do this I need to explicity set a key to the form as a request attribute? (Somehow I assumed that the form already would be set as an attribute and that all I would need to do is modify the values of it). When Struts calls execute(mapping ,form,request,response), the form that it passes in is determined by the "name" attribute of the ActionMapping. The name, of course, must reference a element, which determines the type. The ActionForm specified in the ActionMapping is intended as the wrapper for request parameters, so only in limited cases will it also be of the correct type for the subsequent view. If the only request parameter your action needs is the ID of the VO object you'll retrieve for population, then you could probably get away with specifying the "view form" (or "output form") in the ActionMapping. It's just important to note that this isn't how Struts is designed, and that inevitably, you'll come upon a case where you need to pass in more input data and therefore really need distinct form-beans for "input" and "output". I believe in letting consenting adults do what they please, and so if you understand this, I think you can do it safely. Some people are kind of purists and insist on having a form bean even for the single ID parameter which might be coming in to your action. Getting back to specifics, Struts uses the "name" and "scope" properties of an action-mapping to pass form beans between the controller and the view. If your pre-view action and your form-submission action have the same values then everything should work out (with a possible exception if you are using "request" scope and use a redirect, which would cause the "controller request" to go out-of-scope before the view can be drawn using that data. In the case when you can't use the same form-bean in your action and in the subsequent view and yet you want to pre-populate a form in your view, you simply must ensure that a form-bean of the proper type is placed in the proper scope under the proper name by your action (or by a Tiles controller, or by any other logic that can sneak in before the view is rendered). Hope that helps! Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logging
No ..no...its not an issue at all. Use it the way "Apurva" has mentioned. It works !! Regds R-a-v-i -Original Message- From: Shinobu Kawai [mailto:[EMAIL PROTECTED] Sent: Monday, July 12, 2004 11:53 AM To: Struts Users Mailing List Subject: Re: logging Hi Viral, > I am using commons-logging (using log4j) for logging.. > > We do following logging style... > > if (logger.isDebugEnabled()) > { > logger.debug("Method Name : + some Message"); > } > > Here can we get the method name using java reflection or some other > way so that no need to pass the method name while logging the message > ..??? I believe this is a log4j issue. Take a look at http://logging.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout. html and you should see "some other way". ;) Good luck! -- Shinobu Kawai -- Shinobu Kawai <[EMAIL PROTECTED], [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]
Checkboxes
Hi I am using struts and want to display a list of options for the user to select with checkboxes using the struts-el tags. The information on each option is stored in an object, name, age height weight and each of these objects is stored in an ArrayList called people which is placed in the session. Name of object person name of ArrayList people. I want the information to be displayed as a table(using a loop) each row holding the information on a different person with check boxes at the end of each row. The user can check as many as they want. I can get the people ArrayList from the session scope but don't know how to access the person objects within it or how display the data with in each person object . I have played around with it for a long time but have not had any success. Thanks for any help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANNOUNCE] Silicon Valley Web Developer JUG
FYI, After learning about JUG support as projects on java.net at JavaOne, I decided to migrate the Silicon Valley Struts User JUG to a new JUG project on java.net. The other significant change to the group is the shift to a more general focus on all J2EE web application development technologies. Of course, we will continue to have some meetings where Struts development is the focus. The new JUG project on java.net is: Silicon Valley Web Developer JUG https://sv-web-jug.dev.java.net Everyone on the old Yahoo list are already migrated to the new list. For anyone new though, it does require that you register with java.net in order to subscribe to the new list. If you would like to become a member of this JUG, you can subscribe to the mailing list here: https://sv-web-jug.dev.java.net/servlets/ProjectMailingListList When the group does have a Struts-related event coming up, I'll continue to post announcements here on the struts-user list. However, the frequency of those postings will be lower now with the broader focus of the group going forward. That's All Folks, Van Mike "Van" Riper mailto:[EMAIL PROTECTED] https://sv-web-jug.dev.java.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms
From: "Amleto Di Salle" <[EMAIL PROTECTED]> > But a question: Are you using the html tags inside your jsp? > If yes, you can put the VO in the request and use the "value" (for > example value="${requestScope.anObject.aProperty}") attribute in the > html tags (for example "html:text). If you do that, you'll have a problem if you need to re-display the users input if it fails validation. With a 'value' attribute, that's always what will get displayed, not the value in the form bean. Pre-population belongs in the Action code, then Struts can properly handle what to display in the HTML form. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: R: Prepopulating forms
Yes, I am using the html tags. I thought of what you are saying, but if I understand the responses of others correctly (particularly Wendy), just calling the setters of your form in your "prepopulate" action should take care of this; you shouldn't have to explicity provide any values to your html tags. At least in simplistic/typical situations this seemingly would work. (In other words, the Struts html tags are going to prepopulate for you). I think also though Joe's comments about possibly needing different form beans for input/output should be considered. I recall that when I set the "value" property on any of my inputs, I ran into a problem with user input changes being "remembered" in the case of a page reload due to form validation failure. Someone correct me if I am wrong please. Erik Amleto Di Salle wrote: Hi all, you can use the action in order to obtain the VO. But a question: Are you using the html tags inside your jsp? If yes, you can put the VO in the request and use the "value" (for example value="${requestScope.anObject.aProperty}") attribute in the html tags (for example "html:text). I would like to appreciate some comments in order to use this solution. BR /Amleto -Messaggio originale- Da: Erik Weber [mailto:[EMAIL PROTECTED] Inviato: lunedì 12 luglio 2004 18.17 A: Struts Users Mailing List Oggetto: Re: Prepopulating forms Joe, thanks for your opinion. You and Rick have convinced me to stay with one form page for add/update. I did this before in a non-struts app, and despite all the conditionals I ended up with, the ensuing layout revisions did make it worth it. So, Joe, I am not using Dyna Forms, just plain old form beans. (I may refactor my DTOs/VOs and form beans into some base class because of all the shared fields, but for now, I'm getting a lot of use out of a bean generator I wrote). Are you agreeing then, that the best approach (currently) is to create an action for the view screen (in this case, the "update" form page), and in that action, obtain a VO and use the values from that to set the properties of the ActionForm? You are saying if I do this I need to explicity set a key to the form as a request attribute? (Somehow I assumed that the form already would be set as an attribute and that all I would need to do is modify the values of it). Thanks again, Erik Joe Germuska wrote: In my experience, it helps all involved to avoid redundancy and copying. If you logically treat inserts and updates as more "same" than "different" then you're better off making one page with conditionals. This serves as implicit documentation of the fact that they are more the same, while having two JSPs suggests that they are more different. Someone who doesn't know the details (including you in the future after your next project crowds out the details of this one) will understand better if you only duplicate things when there is a good reason for it. In my personal taste and experience, avoiding conditional logic blocks in a form isn't a good reason for it. As for performing the pre-population, this is somewhat cumbersome. If you are not using a session-scoped form, then it is somewhat tricky to get a handle on the "output form" which needs populating. The Struts "execute" signature passes in an "input form" based on request parameters. Even if you were using session scoped forms, this assumes that you want to use the same form bean for input and output, which is often not the case. If your form bean is a simple non-dynamic form, then it's not too big a deal to instantiate the bean, populate it, and put it in request or session scope under the "name" attribute associated with the action which receives the form submission. This is the bare minimum to do to "make it work." If you're using DynaForms, it's a little harder to get an instance. In the Struts 1.3 timeline, I'm hoping to work on some things to make this easier. If you are interested in the details and in being on the "bleeding edge," feel free to subscribe to the [EMAIL PROTECTED] list where this would be discussed/critiqued/etc. I can't use the pending release of 1.2.1 as an excuse any more, so now I just have to squeeze time into my schedule to get started. Joe At 10:31 AM -0400 7/12/04, Erik Weber wrote: Hello. I want to solicit some advice and opinions. Working on my first Struts app. I have some use cases that call for typcial "add" and "update" functionality that basically can share the same forms. Obviously when the form is first displayed under "add" conditions, it needs to be blank. Under "update" conditions, the form needs to be prepopulated using the results of a DB select. In addition, a few fields that are present under "add" conditions no longer should be present under "update" conditions. My current plan is to: 1) Use two different JSPs to house these forms, even though there will be a lot of redundancy, beca
Re: Tiles and Oracle ADF in JDeveloper10g
John, If you are using a DataPage (e.g. oracle.adf.controller.struts.actions.DataForwardAction) then the parameter attribute on the Action mapping takes the page that needs to be displayed once the data binding has been processed. That parameter attribute can take a tiles definition without a problem and that being the case, as long as the tag points back to the DataPage all should be OK - I've just tried it here and it works without a hitch. Are you trying to use a DataPage as an individual tile, within a layout? That would perhaps cause what you are seeing. If that's the case then tweek it so that DataPage points to the tiles def as a while rather than the bound JSP and run the DataPage. Regards Duncan Mills http://www.groundside.com/blog Ruffin, John wrote: The basic question is: If using Tiles in an application that uses ADF, how do you change the action of lets say - a submit button on an input form - to return the a components defined in a tiles-def definition? The ADF submit button returns the component where the submit button lives - thus losing the other tiles on the page. The information in this email is confidential and may be legally privileged. It is intended solely for the addressee, and access by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. If you believe that you have received this email in error, please advise us by calling (901) 385 3688, or emailing [EMAIL PROTECTED], and then delete this message and all copies and backups thereof. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms
At 12:16 PM -0400 7/12/04, Erik Weber wrote: Joe, thanks for your opinion. You and Rick have convinced me to stay with one form page for add/update. I did this before in a non-struts app, and despite all the conditionals I ended up with, the ensuing layout revisions did make it worth it. So, Joe, I am not using Dyna Forms, just plain old form beans. (I may refactor my DTOs/VOs and form beans into some base class because of all the shared fields, but for now, I'm getting a lot of use out of a bean generator I wrote). Are you agreeing then, that the best approach (currently) is to create an action for the view screen (in this case, the "update" form page), and in that action, obtain a VO and use the values from that to set the properties of the ActionForm? You are saying if I do this I need to explicity set a key to the form as a request attribute? (Somehow I assumed that the form already would be set as an attribute and that all I would need to do is modify the values of it). When Struts calls execute(mapping ,form,request,response), the form that it passes in is determined by the "name" attribute of the ActionMapping. The name, of course, must reference a element, which determines the type. The ActionForm specified in the ActionMapping is intended as the wrapper for request parameters, so only in limited cases will it also be of the correct type for the subsequent view. If the only request parameter your action needs is the ID of the VO object you'll retrieve for population, then you could probably get away with specifying the "view form" (or "output form") in the ActionMapping. It's just important to note that this isn't how Struts is designed, and that inevitably, you'll come upon a case where you need to pass in more input data and therefore really need distinct form-beans for "input" and "output". I believe in letting consenting adults do what they please, and so if you understand this, I think you can do it safely. Some people are kind of purists and insist on having a form bean even for the single ID parameter which might be coming in to your action. Getting back to specifics, Struts uses the "name" and "scope" properties of an action-mapping to pass form beans between the controller and the view. If your pre-view action and your form-submission action have the same values then everything should work out (with a possible exception if you are using "request" scope and use a redirect, which would cause the "controller request" to go out-of-scope before the view can be drawn using that data. In the case when you can't use the same form-bean in your action and in the subsequent view and yet you want to pre-populate a form in your view, you simply must ensure that a form-bean of the proper type is placed in the proper scope under the proper name by your action (or by a Tiles controller, or by any other logic that can sneak in before the view is rendered). Hope that helps! Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place." - Carlos Santana - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
R: Prepopulating forms
Hi all, you can use the action in order to obtain the VO. But a question: Are you using the html tags inside your jsp? If yes, you can put the VO in the request and use the "value" (for example value="${requestScope.anObject.aProperty}") attribute in the html tags (for example "html:text). I would like to appreciate some comments in order to use this solution. BR /Amleto -Messaggio originale- Da: Erik Weber [mailto:[EMAIL PROTECTED] Inviato: lunedì 12 luglio 2004 18.17 A: Struts Users Mailing List Oggetto: Re: Prepopulating forms Joe, thanks for your opinion. You and Rick have convinced me to stay with one form page for add/update. I did this before in a non-struts app, and despite all the conditionals I ended up with, the ensuing layout revisions did make it worth it. So, Joe, I am not using Dyna Forms, just plain old form beans. (I may refactor my DTOs/VOs and form beans into some base class because of all the shared fields, but for now, I'm getting a lot of use out of a bean generator I wrote). Are you agreeing then, that the best approach (currently) is to create an action for the view screen (in this case, the "update" form page), and in that action, obtain a VO and use the values from that to set the properties of the ActionForm? You are saying if I do this I need to explicity set a key to the form as a request attribute? (Somehow I assumed that the form already would be set as an attribute and that all I would need to do is modify the values of it). Thanks again, Erik Joe Germuska wrote: > In my experience, it helps all involved to avoid redundancy and > copying. If you logically treat inserts and updates as more "same" > than "different" then you're better off making one page with > conditionals. This serves as implicit documentation of the fact that > they are more the same, while having two JSPs suggests that they are > more different. Someone who doesn't know the details (including you in > the future after your next project crowds out the details of this one) > will understand better if you only duplicate things when there is a > good reason for it. In my personal taste and experience, avoiding > conditional logic blocks in a form isn't a good reason for it. > > As for performing the pre-population, this is somewhat cumbersome. If > you are not using a session-scoped form, then it is somewhat tricky to > get a handle on the "output form" which needs populating. The Struts > "execute" signature passes in an "input form" based on request > parameters. Even if you were using session scoped forms, this assumes > that you want to use the same form bean for input and output, which is > often not the case. > > If your form bean is a simple non-dynamic form, then it's not too big > a deal to instantiate the bean, populate it, and put it in request or > session scope under the "name" attribute associated with the action > which receives the form submission. This is the bare minimum to do to > "make it work." If you're using DynaForms, it's a little harder to get > an instance. > > In the Struts 1.3 timeline, I'm hoping to work on some things to make > this easier. If you are interested in the details and in being on the > "bleeding edge," feel free to subscribe to the [EMAIL PROTECTED] list where > this would be discussed/critiqued/etc. I can't use the pending release > of 1.2.1 as an excuse any more, so now I just have to squeeze time > into my schedule to get started. > > Joe > > At 10:31 AM -0400 7/12/04, Erik Weber wrote: > >> Hello. I want to solicit some advice and opinions. Working on my >> first Struts app. >> >> I have some use cases that call for typcial "add" and "update" >> functionality that basically can share the same forms. Obviously when >> the form is first displayed under "add" conditions, it needs to be >> blank. Under "update" conditions, the form needs to be prepopulated >> using the results of a DB select. In addition, a few fields that are >> present under "add" conditions no longer should be present under >> "update" conditions. >> >> My current plan is to: >> >> 1) Use two different JSPs to house these forms, even though there >> will be a lot of redundancy, because the fields may have some >> variation, and because I'm not fond of having conditionals in the >> form (if (add) { } else { //must be update). I suppose the common >> block of fields could be refactored into an include. Any opinions on >> this are welcome. >> >> 2) Prepopulate the "update" form by assigning an action to it. I >> suppose the action would, in the execute method, call a business >> object, get a value object and use the attributes of this object to >> set all the fields of the ActionForm before returning a forward to >> the update form screen. Is this the right approach? I would >> especially like opinions here. My view screens have ".jsp" extensions >> but my screens that have submittable forms have actions that use path >> mapping,
Re: Prepopulating forms
From: "Erik Weber" <[EMAIL PROTECTED]> > Joe, thanks for your opinion. You and Rick have convinced me to stay > with one form page for add/update. I did this before in a non-struts > app, and despite all the conditionals I ended up with, the ensuing > layout revisions did make it worth it. Take a look at LookupDispatchAction. That's what I use to control which CRUD action is happening, and all the code stays in one Action class. Instead of separate 'add' and 'update' Actions, they would be methods within your EditWhateverAction. Dynamic forms or not doesn't really matter... you just use the 'form' object that gets passed into your method. And since it's a reference to the form that's sitting in request or session scope, you don't have to "put" it anywhere, it's already there. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms
Thanks Rick. As I said in another response, I think I will go with a shared add/update form. Also, I think we meant the same thing, as far as action mappings go, I just didn't explain very clearly. Indeed, I think now I will just map an action to every screen and the user will never see "*.jsp" at the end of a URI, but rather things like "/viewdetails" or what have you. You wrote: Using BeanUtils.copyProperties(), it's a piece of cake to update your Form bean from the ValueObject properties. Do you have an example of this, or is there one on your site? I indeed have some properties that are the same between form bean and VO, but some are not (for example my form beans use only Strings, but my VOs use some booleans, ints, etc.) Thanks for your help, Erik Rick Reumann wrote: On Mon, 12 Jul 2004 10:31:29 -0400, Erik Weber <[EMAIL PROTECTED]> wrote: 1) Use two different JSPs to house these forms, even though there will be a lot of redundancy, because the fields may have some variation, and because I'm not fond of having conditionals in the form (if (add) { } else { //must be update). I suppose the common block of fields could be refactored into an include. Any opinions on this are welcome. It depends on 'how' different the forms will be. If they are the same except for a few fields, I'd reuse the same form, even if it means some JSTL 2) Prepopulate the "update" form by assigning an action to it. I suppose the action would, in the execute method, call a business object, get a value object and use the attributes of this object to set all the fields of the ActionForm before returning a forward to the update form screen. Is this the right approach? I think so. Using BeanUtils.copyProperties(), it's a piece of cake to update your Form bean from the ValueObject properties. I would especially like opinions here. My view screens have ".jsp" extensions but my screens that have submittable forms have actions that use path mapping, such as "foo/login" and "foo/register" and "foo/save", and so forth. Is it common to map viewing/prepopulating actions one way and saving/writing actions another? I'm an unclear what you mean be the above. All my pages are jsp pages with .jsp extension but the user never ever will see that in the URL since everything I do forwards through an action. Even just views should forward through an action even if it's just the simple generic ForwardAction. I have heard of the use of the "reset" method in an Action for prepopulating a form, and indeed it looks convenient. It should never pre-populate it with business data, but it's ok to use it for making sure certain values are reset to defaults... such as checkboxes, radio buttons, etc. You really need to make use of the reset method if you have checkboxes on your form and you are using validation or the form has session scope. Just don't think of pre-populating meaning prepopulating from your backend - that stuff should be done in your Action. I usually use some form of DispatchAction and usually always have a SetUp() method that does all my population from the ValueObject(s). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms
Joe, thanks for your opinion. You and Rick have convinced me to stay with one form page for add/update. I did this before in a non-struts app, and despite all the conditionals I ended up with, the ensuing layout revisions did make it worth it. So, Joe, I am not using Dyna Forms, just plain old form beans. (I may refactor my DTOs/VOs and form beans into some base class because of all the shared fields, but for now, I'm getting a lot of use out of a bean generator I wrote). Are you agreeing then, that the best approach (currently) is to create an action for the view screen (in this case, the "update" form page), and in that action, obtain a VO and use the values from that to set the properties of the ActionForm? You are saying if I do this I need to explicity set a key to the form as a request attribute? (Somehow I assumed that the form already would be set as an attribute and that all I would need to do is modify the values of it). Thanks again, Erik Joe Germuska wrote: In my experience, it helps all involved to avoid redundancy and copying. If you logically treat inserts and updates as more "same" than "different" then you're better off making one page with conditionals. This serves as implicit documentation of the fact that they are more the same, while having two JSPs suggests that they are more different. Someone who doesn't know the details (including you in the future after your next project crowds out the details of this one) will understand better if you only duplicate things when there is a good reason for it. In my personal taste and experience, avoiding conditional logic blocks in a form isn't a good reason for it. As for performing the pre-population, this is somewhat cumbersome. If you are not using a session-scoped form, then it is somewhat tricky to get a handle on the "output form" which needs populating. The Struts "execute" signature passes in an "input form" based on request parameters. Even if you were using session scoped forms, this assumes that you want to use the same form bean for input and output, which is often not the case. If your form bean is a simple non-dynamic form, then it's not too big a deal to instantiate the bean, populate it, and put it in request or session scope under the "name" attribute associated with the action which receives the form submission. This is the bare minimum to do to "make it work." If you're using DynaForms, it's a little harder to get an instance. In the Struts 1.3 timeline, I'm hoping to work on some things to make this easier. If you are interested in the details and in being on the "bleeding edge," feel free to subscribe to the [EMAIL PROTECTED] list where this would be discussed/critiqued/etc. I can't use the pending release of 1.2.1 as an excuse any more, so now I just have to squeeze time into my schedule to get started. Joe At 10:31 AM -0400 7/12/04, Erik Weber wrote: Hello. I want to solicit some advice and opinions. Working on my first Struts app. I have some use cases that call for typcial "add" and "update" functionality that basically can share the same forms. Obviously when the form is first displayed under "add" conditions, it needs to be blank. Under "update" conditions, the form needs to be prepopulated using the results of a DB select. In addition, a few fields that are present under "add" conditions no longer should be present under "update" conditions. My current plan is to: 1) Use two different JSPs to house these forms, even though there will be a lot of redundancy, because the fields may have some variation, and because I'm not fond of having conditionals in the form (if (add) { } else { //must be update). I suppose the common block of fields could be refactored into an include. Any opinions on this are welcome. 2) Prepopulate the "update" form by assigning an action to it. I suppose the action would, in the execute method, call a business object, get a value object and use the attributes of this object to set all the fields of the ActionForm before returning a forward to the update form screen. Is this the right approach? I would especially like opinions here. My view screens have ".jsp" extensions but my screens that have submittable forms have actions that use path mapping, such as "foo/login" and "foo/register" and "foo/save", and so forth. Is it common to map viewing/prepopulating actions one way and saving/writing actions another? I have heard of the use of the "reset" method in an Action for prepopulating a form, and indeed it looks convenient. I also have heard Struts developers may want to deprecate this method. Any advice/opinions/links welcome. Thanks, Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional c
How to read from web.xml?
Hi, How can I read from web.xml, say, the application's display name? I've tried several things, but no luck. This isn't really Struts-specific, but I'm sure this is an easy one for many of you. Thanks, Ivan.
Tiles and Oracle ADF in JDeveloper10g
The basic question is: If using Tiles in an application that uses ADF, how do you change the action of lets say - a submit button on an input form - to return the a components defined in a tiles-def definition? The ADF submit button returns the component where the submit button lives - thus losing the other tiles on the page. The information in this email is confidential and may be legally privileged. It is intended solely for the addressee, and access by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. If you believe that you have received this email in error, please advise us by calling (901) 385 3688, or emailing [EMAIL PROTECTED], and then delete this message and all copies and backups thereof. Thank you.
Re: Problem with formatting messages from ApplicationResources.xml
On Mon, 12 Jul 2004 11:34:08 -0400, Asif Rahman <[EMAIL PROTECTED]> wrote: > I tried using the filter attribute , but > that didnt work either. Can someone help me with this? You had the right idea. Filtering is what escapes the special characters like "<" and the default is already "true". This should do what you want: -- - Mike "Van" Riper [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HSQLDV / STRUTS
Yes! "The computer is always right" is a useful thought. At 08:03 AM 7/12/2004, you wrote: Its always the obvious! Michael McGrady <[EMAIL PROTECTED]> 12/07/2004 15:59 Please respond to "Struts Users Mailing List" To: "Struts Users Mailing List" <[EMAIL PROTECTED]> cc: Subject:Re: HSQLDV / STRUTS The correct syntax is "SELECT * FROM At 05:23 AM 7/12/2004, you wrote: >Andre > >What type of commit are you using under JDBC, automatic or manual? Perhaps >you should reply with the offending code so we can see what is happeneing. > Also, what exception handling are you using around the INSERT code, as >you may be handling an exception/error but not doing anything with it. > >Regards > >Christopher Marsh-Bourdon >www.marsh-bourdon.com > > > > > >"Bussie, Andre D" <[EMAIL PROTECTED]> >12/07/2004 13:09 >Please respond to "Struts Users Mailing List" > > > To: [EMAIL PROTECTED] > cc: > Subject:HSQLDV / STRUTS > > > > > > >I'm using HSQLDB I have a Java Action Class that performs an INSERT >(queryStr = "INSERT INTO USERS (PASSWORD, EMAIL) VALUES ('?', '?')";) >query my code indicates that the INSERT is successful however when I >query the Database SELECT * it doesn't show the current >INSERT that was made. Any suggestions on why the code is not being >reflected in the database? > > > > > > > > >- >The information in this e-mail is confidential. It is intended solely for >the addressee. If you are not the intended recipient please notify the >sender immediately and delete this message. Any review, dissemination, >distribution, copying or other use of this communication or the >information in it is strictly prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - The information in this e-mail is confidential. It is intended solely for the addressee. If you are not the intended recipient please notify the sender immediately and delete this message. Any review, dissemination, distribution, copying or other use of this communication or the information in it is strictly prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: 1.2.1 to which Maven repo? (RE: [ANN] Struts 1.2.1 (Beta) Released)
Hi Joe, I agree that users should use iBiblio, just said apache repository because it's mirrored. About the use of the private repo http://cvs.apache.org/builds/java-repository/ seems a good idea to me, but it hasn't been already created, nobody has upload nothing until now? Many apache projects still upload their snapshots to the release repository, ending at iBiblio. Should this be told to the projects that had uploaded snapshots to ibiblio? I am also sure that 1.2.1 should definitely be put at http://cvs.apache.org/builds/java-repository/ Regards. > -Original Message- > From: Joe Germuska [mailto:[EMAIL PROTECTED] > Sent: Monday, July 12, 2004 4:08 PM > To: Struts Users Mailing List > Subject: 1.2.1 to which Maven repo? (RE: [ANN] Struts 1.2.1 > (Beta) Released) > > At 11:34 AM +0200 7/12/04, Carlos Sanchez wrote: > >Hi, > > > >Will you deploy it and the struts-el on the apache maven repository? > >http://www.apache.org/dist/java-repository/struts/jars/ > > I would argue that it doesn't belong in that location until > it is voted a full GA release. > Then again, reviewing what seems to be the "official" word on > using the Apache repositories > (http://article.gmane.org/gmane.comp.jakarta.commons.devel/39469), > it simply says that location is for "versioned releases" as > opposed to "nightly builds". > > For what it's worth, I think that the intention is not that > Maven users would have > http://www.apache.org/dist/java-repository/ as a repository, > but rather than they'd use iBiblio, which is mirrored from > that. I don't know if anyone feels strongly about it, but > that's how I read the previously cited email. > > If we don't put Struts 1.2.1 on iBiblio, we should definitely > put it at http://cvs.apache.org/builds/java-repository/ > > I'll do either one, but I'll wait to see if a few opinions > roll in before taking action. > > Joe > > > > >I have built it from cvs sources with maven and the size is > not the same. > > > >Regards > > > >Carlos Sanchez > >A Coruña, Spain > > > >Oness Project > >http://oness.sourceforge.net > > > > > >> -Original Message- > >> From: Ted Husted [mailto:[EMAIL PROTECTED] > >> Sent: Sunday, July 11, 2004 9:11 PM > >> To: [EMAIL PROTECTED] > >> Cc: [EMAIL PROTECTED] > >> Subject: [ANN] Struts 1.2.1 (Beta) Released > >> > >> The Struts team announces the release of Struts 1.2.1, currently > >> ranked at Beta quality. > >> > >> This release removes many features deprecated in prior releases > >> (Struts 1.1 and Struts 1.0.2) and also provides several new > >> features. Fixes to known problems have been applied. More > detail is > >> available at > >> > >> * http://struts.apache.org/userGuide/release-notes.html > >> > >> The binary, source, and library distributions are available at > >> > >> * http://cvs.apache.org/dist/struts/v1.2.1/ > >> > >> The library distribution contains only the requisite > JARs, without > >> the documentation or example applications. > >> > >> We invite your comments on how well this release works with your > >> own applications. Based on feedback from the Struts > community, this > >> release may be dubbed "ready for prime time" > >> and promoted to "General Availabilty" quality. > >> > >> Please note that Struts now uses "Tomcat-style" releases. If the > >> feedback on this release were positive, Struts 1.2.1 may > be promoted > >> directly to "GA", without creating yet-another distribution. If a > >> serious problem were found and fixed, then we will issue Struts > >> 1.2.2 and try again. > >> > >> > >> > >> > >> > >> > >> > - > >> 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] > > > -- > Joe Germuska > [EMAIL PROTECTED] > http://blog.germuska.com > "In fact, when I die, if I don't hear 'A Love Supreme,' I'll > turn back; I'll know I'm in the wrong place." > - Carlos Santana > > - > 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]
Problem with formatting messages from ApplicationResources.xml
I included in one of the entries in the ApplicationResources. Im not sure if that is allowed. This is what I get in my jsp output: a.. Your payment of $750.00 has been approved! Your Order ID is 6690. Please print this page for your records. I tried using the filter attribute , but that didnt work either. Can someone help me with this? -Asif
Re: Prepopulating forms
In my experience, it helps all involved to avoid redundancy and copying. If you logically treat inserts and updates as more "same" than "different" then you're better off making one page with conditionals. This serves as implicit documentation of the fact that they are more the same, while having two JSPs suggests that they are more different. Someone who doesn't know the details (including you in the future after your next project crowds out the details of this one) will understand better if you only duplicate things when there is a good reason for it. In my personal taste and experience, avoiding conditional logic blocks in a form isn't a good reason for it. As for performing the pre-population, this is somewhat cumbersome. If you are not using a session-scoped form, then it is somewhat tricky to get a handle on the "output form" which needs populating. The Struts "execute" signature passes in an "input form" based on request parameters. Even if you were using session scoped forms, this assumes that you want to use the same form bean for input and output, which is often not the case. If your form bean is a simple non-dynamic form, then it's not too big a deal to instantiate the bean, populate it, and put it in request or session scope under the "name" attribute associated with the action which receives the form submission. This is the bare minimum to do to "make it work." If you're using DynaForms, it's a little harder to get an instance. In the Struts 1.3 timeline, I'm hoping to work on some things to make this easier. If you are interested in the details and in being on the "bleeding edge," feel free to subscribe to the [EMAIL PROTECTED] list where this would be discussed/critiqued/etc. I can't use the pending release of 1.2.1 as an excuse any more, so now I just have to squeeze time into my schedule to get started. Joe At 10:31 AM -0400 7/12/04, Erik Weber wrote: Hello. I want to solicit some advice and opinions. Working on my first Struts app. I have some use cases that call for typcial "add" and "update" functionality that basically can share the same forms. Obviously when the form is first displayed under "add" conditions, it needs to be blank. Under "update" conditions, the form needs to be prepopulated using the results of a DB select. In addition, a few fields that are present under "add" conditions no longer should be present under "update" conditions. My current plan is to: 1) Use two different JSPs to house these forms, even though there will be a lot of redundancy, because the fields may have some variation, and because I'm not fond of having conditionals in the form (if (add) { } else { //must be update). I suppose the common block of fields could be refactored into an include. Any opinions on this are welcome. 2) Prepopulate the "update" form by assigning an action to it. I suppose the action would, in the execute method, call a business object, get a value object and use the attributes of this object to set all the fields of the ActionForm before returning a forward to the update form screen. Is this the right approach? I would especially like opinions here. My view screens have ".jsp" extensions but my screens that have submittable forms have actions that use path mapping, such as "foo/login" and "foo/register" and "foo/save", and so forth. Is it common to map viewing/prepopulating actions one way and saving/writing actions another? I have heard of the use of the "reset" method in an Action for prepopulating a form, and indeed it looks convenient. I also have heard Struts developers may want to deprecate this method. Any advice/opinions/links welcome. Thanks, Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place." - Carlos Santana - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts work in NYC
Those are _very_ low rates for NYC! -Original Message- From: Eric Dahnke [mailto:[EMAIL PROTECTED] Sent: Monday, July 12, 2004 10:54 AM To: [EMAIL PROTECTED] Subject: Struts work in NYC I hope posting contract work is OK in the list guidelines. We have a Struts/Java Developer opening. 3-4 months w/ strong possiblity of extension. $40-48/hr Struts, Java web development work. Some XML, some workflow, the usual suspects. Please see the following, and use it to apply for the position. http://newyork.craigslist.org/mnh/sof/35823005.html Sincerely, Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating forms
On Mon, 12 Jul 2004 10:31:29 -0400, Erik Weber <[EMAIL PROTECTED]> wrote: 1) Use two different JSPs to house these forms, even though there will be a lot of redundancy, because the fields may have some variation, and because I'm not fond of having conditionals in the form (if (add) { } else { //must be update). I suppose the common block of fields could be refactored into an include. Any opinions on this are welcome. It depends on 'how' different the forms will be. If they are the same except for a few fields, I'd reuse the same form, even if it means some JSTL 2) Prepopulate the "update" form by assigning an action to it. I suppose the action would, in the execute method, call a business object, get a value object and use the attributes of this object to set all the fields of the ActionForm before returning a forward to the update form screen. Is this the right approach? I think so. Using BeanUtils.copyProperties(), it's a piece of cake to update your Form bean from the ValueObject properties. I would especially like opinions here. My view screens have ".jsp" extensions but my screens that have submittable forms have actions that use path mapping, such as "foo/login" and "foo/register" and "foo/save", and so forth. Is it common to map viewing/prepopulating actions one way and saving/writing actions another? I'm an unclear what you mean be the above. All my pages are jsp pages with .jsp extension but the user never ever will see that in the URL since everything I do forwards through an action. Even just views should forward through an action even if it's just the simple generic ForwardAction. I have heard of the use of the "reset" method in an Action for prepopulating a form, and indeed it looks convenient. It should never pre-populate it with business data, but it's ok to use it for making sure certain values are reset to defaults... such as checkboxes, radio buttons, etc. You really need to make use of the reset method if you have checkboxes on your form and you are using validation or the form has session scope. Just don't think of pre-populating meaning prepopulating from your backend - that stuff should be done in your Action. I usually use some form of DispatchAction and usually always have a SetUp() method that does all my population from the ValueObject(s). -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HSQLDV / STRUTS
Its always the obvious! Michael McGrady <[EMAIL PROTECTED]> 12/07/2004 15:59 Please respond to "Struts Users Mailing List" To: "Struts Users Mailing List" <[EMAIL PROTECTED]> cc: Subject:Re: HSQLDV / STRUTS The correct syntax is "SELECT * FROM At 05:23 AM 7/12/2004, you wrote: >Andre > >What type of commit are you using under JDBC, automatic or manual? Perhaps >you should reply with the offending code so we can see what is happeneing. > Also, what exception handling are you using around the INSERT code, as >you may be handling an exception/error but not doing anything with it. > >Regards > >Christopher Marsh-Bourdon >www.marsh-bourdon.com > > > > > >"Bussie, Andre D" <[EMAIL PROTECTED]> >12/07/2004 13:09 >Please respond to "Struts Users Mailing List" > > > To: [EMAIL PROTECTED] > cc: > Subject:HSQLDV / STRUTS > > > > > > >I'm using HSQLDB I have a Java Action Class that performs an INSERT >(queryStr = "INSERT INTO USERS (PASSWORD, EMAIL) VALUES ('?', '?')";) >query my code indicates that the INSERT is successful however when I >query the Database SELECT * it doesn't show the current >INSERT that was made. Any suggestions on why the code is not being >reflected in the database? > > > > > > > > >- >The information in this e-mail is confidential. It is intended solely for >the addressee. If you are not the intended recipient please notify the >sender immediately and delete this message. Any review, dissemination, >distribution, copying or other use of this communication or the >information in it is strictly prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - The information in this e-mail is confidential. It is intended solely for the addressee. If you are not the intended recipient please notify the sender immediately and delete this message. Any review, dissemination, distribution, copying or other use of this communication or the information in it is strictly prohibited.
RE: Form with n columns and m raws
thanks a lot Atta, it is working fine. -Message d'origine- De : atta-ur rehman [mailto:[EMAIL PROTECTED] Envoyé : vendredi 9 juillet 2004 20:09 À : Struts Users Mailing List Objet : Re: Form with n columns and m raws Hello Damien, have a new class called row: public class Row { private List items; public Row(int size, String defaultValue) { items = new ArrayList(size); for (int i = 0; i < size; i++) { items.add(defaultValue); } } public Row(int size) { this(size, ""); } public List getItems() { return items; } public void setItems(List items) { this.items = items; } public int size() { return items.size(); } } now in your ActionForm class: public List getDemandGrid() { return demandGrid; } public void setDemandGrid(List list) { demandGrid = list; } in your action class setup the initial grid: List demandGrid = new ArrayList(demandCount); for (int i = 0; i < ?; i++) { demandRow = new Row(quarters.size(), "OFF"); demandGrid.add(deamndRow); } form.setDemandGrid(demandGrid); in your jsp: <% height = businessRevForecastForm.getDemandGrid().size(); width = ((Row) businessRevForecastForm.getDemandGrid().get(0)).size(); grid = businessRevForecastForm.getDemandGrid(); %> <% for (int y = 0; y < height; y++) { %> <% for (int x = 0; x < width; x++) { %> <% } %> <% } %> after submit, form.getDemandGrid() list should be populated! hope this helps. ATTA - Original Message - From: "Damien SAUVAGEOT" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 09, 2004 8:12 AM Subject: Form with n columns and m raws Hello, I can't find how to implement a form which include n*m checkbox. I would like to get : doc1 doc2 doc3 ... docn client1 x x x client2 x x x client 3 x x x ... client m x x x x I managed to get the form but I can't retrieve the values in the validate function private String[][] enveloppes; in reset : enveloppes = new String[n][m]; for(int i = 0; i < m; i++) { for (int j=0; j < n; j++) { enveloppes[j][i] = "off"; } } and for example, i get an array of 2*10 elements. but when I check the size of enveloppes into the validate function, I get a strange size of 1*1. There is also the getter/setter : /** * @return Returns the enveloppes. */ public String[][] getEnveloppes() { return enveloppes; } /** * @param enveloppes The enveloppes to set. */ public void setEnveloppes(String[][] enveloppes) { this.enveloppes = enveloppes; } Does anyone know the reason why the enveloppe size isn't 2*10? I tried to log a lot of stuff and was not able to determine anything. The setter is apparently never called. I guess Struts is in charge of populating the form when it is sent back by the browser. I managed to use array of 1 dimension with struts form, even if I had quite a hard time to figure out how to make it works but I can't find any solution for 2 dimensions arrays. the generated html corresponding parts are : ... ... Thanks for the help, Damien - 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: HSQLDV / STRUTS
The correct syntax is "SELECT * FROM At 05:23 AM 7/12/2004, you wrote: Andre What type of commit are you using under JDBC, automatic or manual? Perhaps you should reply with the offending code so we can see what is happeneing. Also, what exception handling are you using around the INSERT code, as you may be handling an exception/error but not doing anything with it. Regards Christopher Marsh-Bourdon www.marsh-bourdon.com "Bussie, Andre D" <[EMAIL PROTECTED]> 12/07/2004 13:09 Please respond to "Struts Users Mailing List" To: [EMAIL PROTECTED] cc: Subject:HSQLDV / STRUTS I'm using HSQLDB I have a Java Action Class that performs an INSERT (queryStr = "INSERT INTO USERS (PASSWORD, EMAIL) VALUES ('?', '?')";) query my code indicates that the INSERT is successful however when I query the Database SELECT * it doesn't show the current INSERT that was made. Any suggestions on why the code is not being reflected in the database? - The information in this e-mail is confidential. It is intended solely for the addressee. If you are not the intended recipient please notify the sender immediately and delete this message. Any review, dissemination, distribution, copying or other use of this communication or the information in it is strictly prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts work in NYC
I hope posting contract work is OK in the list guidelines. We have a Struts/Java Developer opening. 3-4 months w/ strong possiblity of extension. $40-48/hr Struts, Java web development work. Some XML, some workflow, the usual suspects. Please see the following, and use it to apply for the position. http://newyork.craigslist.org/mnh/sof/35823005.html Sincerely, Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: HSQLDV / STRUTS - (this has nothing to do with Struts)
I did not see your initial post, but to help clear this, let me say that, if you don't want to have to keep a connection to the database, then don't run "all-in-memory". At 05:37 AM 7/12/2004, you wrote: Is this the same post that was sent last week? or week before? I believe I asked you a question that you never responded to. What mode are you running in? http://hsqldb.sourceforge.net/web/hsqlModes.html A few weeks ago, as I was finishing up several database implementations of commons-resources, I noticed that when I ran the tests with HSQLDB in "All-In-Memory" mode, you have to keep a connection to the database or you will lose everything, including your tables. The only other suggestion I can make is to add ';' to your statement. > (queryStr = "INSERT INTO USERS (PASSWORD, EMAIL) VALUES ('?', '?');";) ^ You really should read the docs for HSQLDB. http://hsqldb.sourceforge.net/web/hsqlDocsFrame.html -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx - Original Message - From: "Bussie, Andre D" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 12, 2004 8:09 AM Subject: HSQLDV / STRUTS > > > > > I'm using HSQLDB I have a Java Action Class that performs an INSERT > (queryStr = "INSERT INTO USERS (PASSWORD, EMAIL) VALUES ('?', '?')";) > query my code indicates that the INSERT is successful however when I > query the Database SELECT * it doesn't show the current > INSERT that was made. Any suggestions on why the code is not being > reflected in the database? > > > > - 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]
ANN: New Struts/OracleADF-based Toy Store Demo
Oracle announces the availability of the Struts-based ADF Toy Store Demo sample application. http://otn.oracle.com/products/jdev/collateral/papers/10g/adftoystore.html It is accompanied by a detailed technical whitepaper that explains all of the interesting details of the Struts and Oracle ADF framework features used in its implementation. http://otn.oracle.com/products/jdev/collateral/papers/10g/adftoystore/readme.html The ADF Toy Store Demo is an MVC-based web storefront application, implemented using best-practices J2EE design patterns, that fully leverages the developer-productivity boost that frameworks and framework-savvy visual tools can provide. It uses: -> Apache Struts for the controller layer -> JSP/JSTL for the view layer -> Oracle Application Development Framework (ADF) for the model layer As part of explaining the implementation details, the whitepaper illustrates the rich set of features provided by the Oracle JDeveloper 10g IDE for working with the Struts and ADF frameworks using productive visual, declarative, and code-level tools. The demo can be deployed to Tomcat, Oracle Application Server, Oracle OC4J Standalone, or other J2EE-compliant application server. The Oracle ADF framework's capabilities for simplifying end-to-end J2EE application development are used daily by over 2000 developers in the Oracle E-Business Suite team, as well as by hundreds of external customers. ADF's data binding layer is an implementation of the declarative data binding facilities proposed in JSR-227. Steve Muench - Technical Evangelist, Product Mgr, Developer, Author - Oracle http://radio.weblogs.com/0118231/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Prepopulating forms
Hello. I want to solicit some advice and opinions. Working on my first Struts app. I have some use cases that call for typcial "add" and "update" functionality that basically can share the same forms. Obviously when the form is first displayed under "add" conditions, it needs to be blank. Under "update" conditions, the form needs to be prepopulated using the results of a DB select. In addition, a few fields that are present under "add" conditions no longer should be present under "update" conditions. My current plan is to: 1) Use two different JSPs to house these forms, even though there will be a lot of redundancy, because the fields may have some variation, and because I'm not fond of having conditionals in the form (if (add) { } else { //must be update). I suppose the common block of fields could be refactored into an include. Any opinions on this are welcome. 2) Prepopulate the "update" form by assigning an action to it. I suppose the action would, in the execute method, call a business object, get a value object and use the attributes of this object to set all the fields of the ActionForm before returning a forward to the update form screen. Is this the right approach? I would especially like opinions here. My view screens have ".jsp" extensions but my screens that have submittable forms have actions that use path mapping, such as "foo/login" and "foo/register" and "foo/save", and so forth. Is it common to map viewing/prepopulating actions one way and saving/writing actions another? I have heard of the use of the "reset" method in an Action for prepopulating a form, and indeed it looks convenient. I also have heard Struts developers may want to deprecate this method. Any advice/opinions/links welcome. Thanks, Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
1.2.1 to which Maven repo? (RE: [ANN] Struts 1.2.1 (Beta) Released)
At 11:34 AM +0200 7/12/04, Carlos Sanchez wrote: Hi, Will you deploy it and the struts-el on the apache maven repository? http://www.apache.org/dist/java-repository/struts/jars/ I would argue that it doesn't belong in that location until it is voted a full GA release. Then again, reviewing what seems to be the "official" word on using the Apache repositories (http://article.gmane.org/gmane.comp.jakarta.commons.devel/39469), it simply says that location is for "versioned releases" as opposed to "nightly builds". For what it's worth, I think that the intention is not that Maven users would have http://www.apache.org/dist/java-repository/ as a repository, but rather than they'd use iBiblio, which is mirrored from that. I don't know if anyone feels strongly about it, but that's how I read the previously cited email. If we don't put Struts 1.2.1 on iBiblio, we should definitely put it at http://cvs.apache.org/builds/java-repository/ I'll do either one, but I'll wait to see if a few opinions roll in before taking action. Joe I have built it from cvs sources with maven and the size is not the same. Regards Carlos Sanchez A Coruña, Spain Oness Project http://oness.sourceforge.net -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Sunday, July 11, 2004 9:11 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [ANN] Struts 1.2.1 (Beta) Released The Struts team announces the release of Struts 1.2.1, currently ranked at Beta quality. This release removes many features deprecated in prior releases (Struts 1.1 and Struts 1.0.2) and also provides several new features. Fixes to known problems have been applied. More detail is available at * http://struts.apache.org/userGuide/release-notes.html The binary, source, and library distributions are available at * http://cvs.apache.org/dist/struts/v1.2.1/ The library distribution contains only the requisite JARs, without the documentation or example applications. We invite your comments on how well this release works with your own applications. Based on feedback from the Struts community, this release may be dubbed "ready for prime time" and promoted to "General Availabilty" quality. Please note that Struts now uses "Tomcat-style" releases. If the feedback on this release were positive, Struts 1.2.1 may be promoted directly to "GA", without creating yet-another distribution. If a serious problem were found and fixed, then we will issue Struts 1.2.2 and try again. - 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] -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place." - Carlos Santana - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Better way?
Hi, When I want to open a new browser window to access an offsite URL, I have been loading a jsp with a frameset containing that URL, i.e. "return new ActionForward ("/offsiteFrameset.jsp")". For example, to open a URL from a page of offsite links. Is there a better or more direct way of doing it? Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logging
Hi Apurva, We are having a class level variable as you mentioned as below org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(ResResourceManager.class.getName() ); I think the difference will be in the log4j.appender.R.layout.ConversionPattern=%d, [%t], %-5p, %c, - %m%n in log4jconfig.properties file. Could you please let me know log4j.appender.R.layout.ConversionPattern value ..?? Thanks, Viral -Original Message- From: Apurva Goswami [mailto:[EMAIL PROTECTED] Sent: Monday, July 12, 2004 11:50 AM To: 'Struts Users Mailing List' Subject: RE: logging Try Put these lines on top of your class file // Log4j // Log4j with Try-Catch: try {...} catch (Exception e) { cat.error(e, e); } static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance("File Name".class.getName()); E.g. static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(ResResourceManager.class.getName() ); Use these methods as per your requirement cat.debug() - > cat.debug("", e); cat.error() - > cat.error("", e); cat.fatal() - > cat.fatal("", e); It prints the method name in the log and you do not need to pass. E.g. if I use statement : if (cat.isDebugEnabled()) cat.debug("Retrieved " + agencyDepPortsDropDownList.count() + " " + countrycode + " Ports"); I get this in my log file : (CoreFareMainL:3515 initAgencyDepPortsDropDownList) - Retrieved 117 AU Ports (Class file: linenumber method ) - string message Hope it helps Cheers Apurva -Original Message- From: Viral_Thakkar [mailto:[EMAIL PROTECTED] Sent: Monday, July 12, 2004 4:03 PM To: Struts Users Mailing List Subject: logging Hi All, I am using commons-logging (using log4j) for logging.. We do following logging style... if (logger.isDebugEnabled()) { logger.debug("Method Name : + some Message"); } Here can we get the method name using java reflection or some other way so that no need to pass the method name while logging the message ..??? Regards, Viral - 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: Browser's refresh problem
Use Struts isTokenValid/saveToken schema in your addUsetToDatabase Action method. Cheers. Guillermo. -Original Message- From: Ding Lei [mailto:[EMAIL PROTECTED] Sent: Lunes, 12 de Julio de 2004 10:38 a.m. To: Struts Users Mailing List Subject: Browser's refresh problem Hi all, There's a UserAddAction, which adds the user record to the database, and when it's done it redirects the user index page. the problem is that everytime the user clicks refresh at the user index page, the same record is added again. I know that unique check is required, but I also hopes that action itself should be aware of the user's "Refresh". Thank you. -- Layman <[EMAIL PROTECTED]> Ext: 8059 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] NOTA DE CONFIDENCIALIDAD Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts design problem, any help?
ok then , I try to figure out myself thanks a lot, ^^ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Browser's refresh problem
Hi Ding Lei: Use a redirect instead of a forward and that will solve your problem.. Geeta > -Original Message- > From: Ding Lei [mailto:[EMAIL PROTECTED] > Sent: Monday, July 12, 2004 9:38 AM > To: Struts Users Mailing List > Subject: Browser's refresh problem > > > Hi all, > > There's a UserAddAction, which adds the user record to the > database, and > when it's done it redirects the user index page. the problem > is that everytime > the user clicks refresh at the user index page, the same > record is added > again. > > I know that unique check is required, but I also hopes that > action itself > should be aware of the user's "Refresh". > > Thank you. > > > -- > Layman <[EMAIL PROTECTED]> Ext: 8059 > > - > 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]
Browser's refresh problem
Hi all, There's a UserAddAction, which adds the user record to the database, and when it's done it redirects the user index page. the problem is that everytime the user clicks refresh at the user index page, the same record is added again. I know that unique check is required, but I also hopes that action itself should be aware of the user's "Refresh". Thank you. -- Layman <[EMAIL PROTECTED]> Ext: 8059 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: HSQLDV / STRUTS - (this has nothing to do with Struts)
Is this the same post that was sent last week? or week before? I believe I asked you a question that you never responded to. What mode are you running in? http://hsqldb.sourceforge.net/web/hsqlModes.html A few weeks ago, as I was finishing up several database implementations of commons-resources, I noticed that when I ran the tests with HSQLDB in "All-In-Memory" mode, you have to keep a connection to the database or you will lose everything, including your tables. The only other suggestion I can make is to add ';' to your statement. > (queryStr = "INSERT INTO USERS (PASSWORD, EMAIL) VALUES ('?', '?');";) ^ You really should read the docs for HSQLDB. http://hsqldb.sourceforge.net/web/hsqlDocsFrame.html -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx - Original Message - From: "Bussie, Andre D" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 12, 2004 8:09 AM Subject: HSQLDV / STRUTS > > > > > I'm using HSQLDB I have a Java Action Class that performs an INSERT > (queryStr = "INSERT INTO USERS (PASSWORD, EMAIL) VALUES ('?', '?')";) > query my code indicates that the INSERT is successful however when I > query the Database SELECT * it doesn't show the current > INSERT that was made. Any suggestions on why the code is not being > reflected in the database? > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html tags in resource bundle
Ok I gave this a try and it worked. However something VERY weird happened. Since I am using tiles, all of my forwards go to a tiles definition. When I tried your suggestion: String replacementLink = mapping.findForward("audit.app.login").getPath(); super.saveMessage(request, "auditapp.login.duplicate.user.error", (String)f.get("email"), replacementLink); return mapping.getInputForward(); the name of the tiles definition in the forward audit.app.login was inserted into the link: login but when I click on the link, I do get to the login page. Like I said in my original email, I am just picking up struts again after a break from it so I am not aware of all the changes that have been made to the framework recently. I would however would like to know that this is normal behavior. Thanks again for your help!!! Juan Greg Ludington <[EMAIL PROTECTED]> wrote: One possibility would be to create a forward (local or global) for the Action you wish to link, and then, when you save ActionMessages, create the link, and then pass it as a parametric replacement to the message. 1) in struts-config.xml, create a forward that maps to the action link you want in your message, e.g. path="/appRegisterLogin.do"/>. 2) Set your message to have another replacement, like: auditapp.login.duplicate.user.error=A user with email address: {0} already exists. If that is your email address, please use that email address as your login along with the password you were supplied. 3) In your Action, obtain the path of the forward, get its path, and place it in the message. Using your code as a basis: catch(DuplicateUserException dupEx){ log.error("Caught DuplicateUserException in execute of AuditAppRegistrationAction"); // This is the link created from the forward you defined in step 1 String replacementLink = mapping.findForward("appRegisterLoginForward").getPath(); super.saveMessage(request, "auditapp.login.duplicate.user.error", (String)f.get("email"), replacementLink); return mapping.getInputForward(); } This way, the creation and rewriting of the link itself is handled by normal struts mechanisms, and you can manage the links in your struts-config.xml file. On Sat, 10 Jul 2004 17:39:32 -0700 (PDT), Juan Alvarado wrote: > Hello everyone: > > I have recently started using struts again and I am a bit rusty so please bear with > me. I searched the list for what I need and I didn't find anything. > > What I need is to display to a user a message in a JSP. This message is pulled from > an ApplicationResources.properties file. What I would like to do is to be able to > display a link to another page in this particular message. > > My key looks like this: > auditapp.login.duplicate.user.error=A user with email address: {0} already exists. > If that is your email address, please use that email address as your login along > with the password you were supplied. > > As you can see it has a struts specific html tag. This of course didn't work. Does > anyone know of an equivalent way to do this. I could use regular html tags (although > I haven't tried it) but I would like to stick with the struts specific stuff as much > as I can. Especially since it will handle url rewriting for you. The above key gets > pulled from an action with the following code: > ... > > catch(DuplicateUserException dupEx){ > > log.error("Caught DuplicateUserException in execute of > AuditAppRegistrationAction"); > > super.saveMessage(request, "auditapp.login.duplicate.user.error", > (String)f.get("email")); > > return mapping.getInputForward(); > > } > > If you have a solution, ideas or suggestions I would appreciate it if you shared > them with me. > > Thanks in advance. > > Juan > > > - > Do you Yahoo!? > New and Improved Yahoo! Mail - Send 10MB messages! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage!
Re: HSQLDV / STRUTS
Andre What type of commit are you using under JDBC, automatic or manual? Perhaps you should reply with the offending code so we can see what is happeneing. Also, what exception handling are you using around the INSERT code, as you may be handling an exception/error but not doing anything with it. Regards Christopher Marsh-Bourdon www.marsh-bourdon.com "Bussie, Andre D" <[EMAIL PROTECTED]> 12/07/2004 13:09 Please respond to "Struts Users Mailing List" To: [EMAIL PROTECTED] cc: Subject:HSQLDV / STRUTS I'm using HSQLDB I have a Java Action Class that performs an INSERT (queryStr = "INSERT INTO USERS (PASSWORD, EMAIL) VALUES ('?', '?')";) query my code indicates that the INSERT is successful however when I query the Database SELECT * it doesn't show the current INSERT that was made. Any suggestions on why the code is not being reflected in the database? - The information in this e-mail is confidential. It is intended solely for the addressee. If you are not the intended recipient please notify the sender immediately and delete this message. Any review, dissemination, distribution, copying or other use of this communication or the information in it is strictly prohibited.
HSQLDV / STRUTS
I'm using HSQLDB I have a Java Action Class that performs an INSERT (queryStr = "INSERT INTO USERS (PASSWORD, EMAIL) VALUES ('?', '?')";) query my code indicates that the INSERT is successful however when I query the Database SELECT * it doesn't show the current INSERT that was made. Any suggestions on why the code is not being reflected in the database?
form focus and validation
After validating a form, how can you get the form to focus on elements with valdation errors? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts design problem, any help?
Hello, Again, can't say explicitly without having knowledge of Everything There's the façade pattern if u want to have a look at it, It may Help.. Regards marco -Original Message- From: Koon Yue Lam [mailto:[EMAIL PROTECTED] Sent: 12 July 2004 10:47 To: Struts Users Mailing List Subject: Re: Struts design problem, any help? thanks for your kind reply For example, for a classic online shop, 1 BD for customer (for check-in, check-out, list product etc...) 1 BD for admin (for update product price, stock etc...) 1 BD for normal user (for web forum, enquiry, feeback etc...) does it looks good? so if my BD doesn't map to exactly one business object that implement the service, like my BD for customer need services from more than one business object (at least one for product, and one for shopping cart) is it the role of BD to handle various object ? or use some others pattern ?? - 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: Struts design problem, any help?
thanks for your kind reply For example, for a classic online shop, 1 BD for customer (for check-in, check-out, list product etc...) 1 BD for admin (for update product price, stock etc...) 1 BD for normal user (for web forum, enquiry, feeback etc...) does it looks good? so if my BD doesn't map to exactly one business object that implement the service, like my BD for customer need services from more than one business object (at least one for product, and one for shopping cart) is it the role of BD to handle various object ? or use some others pattern ?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts design problem, any help?
>I want to know if I implement business delagate as POJO singleton, can >u give me some advice on how to multi-thread this business delagate to >various request ??? >and how about caching ?? How to cache the handler of a business service ?? I don't consider myself so expert on multithreading :-( Pls other comments my 'suggestions' if they r wrong :-) Your BD should simply hide the backend service that you are using (either EJB or some other technologies)..so it should not modify any variables or Do some computation, since it's scope is just to hide what's behind it In that case, you should not need to worry about MT... but if you are Still not satisified, make sure that you don't have too many global Variables (and that you don't modify them..like when u define variables In Servlets, for example...) For caching, again, you can cache the BD by writing a Struts PlugIn that Initializes your BD and put your BD as ServletContext Not sure about what you mean by saying ' to cache the handler of a business Service' .. If you have 1 to 1 mapping between bD and business service, you can initialize it only once inside your BD I can't say more coz I don't know how ur application is structured.. Regards marco - 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: Struts design problem, any help?
Hi, me again, ^^ I want to know if I implement business delagate as POJO singleton, can u give me some advice on how to multi-thread this business delagate to various request ??? and how about caching ?? How to cache the handler of a business service ?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [ANN] Struts 1.2.1 (Beta) Released
Hi, Will you deploy it and the struts-el on the apache maven repository? http://www.apache.org/dist/java-repository/struts/jars/ I have built it from cvs sources with maven and the size is not the same. Regards Carlos Sanchez A Coruña, Spain Oness Project http://oness.sourceforge.net > -Original Message- > From: Ted Husted [mailto:[EMAIL PROTECTED] > Sent: Sunday, July 11, 2004 9:11 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: [ANN] Struts 1.2.1 (Beta) Released > > The Struts team announces the release of Struts 1.2.1, > currently ranked at Beta quality. > > This release removes many features deprecated in prior > releases (Struts 1.1 and Struts 1.0.2) and also provides > several new features. Fixes to known problems have been > applied. More detail is available at > > * http://struts.apache.org/userGuide/release-notes.html > > The binary, source, and library distributions are available at > > * http://cvs.apache.org/dist/struts/v1.2.1/ > > The library distribution contains only the requisite JARs, > without the documentation or example applications. > > We invite your comments on how well this release works with > your own applications. Based on feedback from the Struts > community, this release may be dubbed "ready for prime time" > and promoted to "General Availabilty" quality. > > Please note that Struts now uses "Tomcat-style" releases. If > the feedback on this release were positive, Struts 1.2.1 may > be promoted directly to "GA", without creating yet-another > distribution. If a serious problem were found and fixed, then > we will issue Struts 1.2.2 and try again. > > > > > > - > 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: Struts design problem, any help?
Hello, >Do the system has only one business delagate to control the mapping of >request to business service it depends on how many business delegate you need in your application... it's up to you on how many business delegate you need. For small applications (like mine at home), usually 1 or 2 is Enough.. For large applications, you probably have more but it depends On the functionality of the application >the system has the same number of business delagate and business >service?? so one service would has their own business delegate in theory yes... but again it depends on how big is your application if you write 2 BD, they should not have anything in common between the two (so, probably they will interact with two completely different busness services) unless,a gain, ur application Is so small that you can get away with only one BD... regards marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts design problem, any help?
sorry, one more question.. I have read the business delagate pattern a while but still have little confuse Do the system has only one business delagate to control the mapping of request to business service OR the system has the same number of business delagate and business service?? so one service would has their own business delagate any sample code?? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts design problem, any help?
Hello, >Thanks for the reply and I want to know more... ^^ >I know what means by Business delegate Factory, but what is "a plugIn >for your factory" ?? by plugIn I meant Struts PlugIn (check struts docs, http://jakarta.apache.orgs/struts) a Struts PlugIn allows you to configure components that have application scope (no session, no request). It was just a suggestion, because you could implement also the factory As a singleton >Do I need to implement Business delegate Factory by myself? yep >Will Struts help me in some way?? Eventually with the Stuts PlugIn, If you go that way... Regards marco Regards - 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: Struts design problem, any help?
Thanks for the reply and I want to know more... ^^ I know what means by Business delegate Factory, but what is "a plugIn for your factory" ?? Do I need to implement Business delegate Factory by myself? Will Struts help me in some way?? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts design problem, any help?
Hello, My 2 cents.. Afaik ServiceLocator is used mainly for looking up JNDI objects, because it saves you from instantiating a new Context Every time.. It seems that what you are talking about is a Business delegate Factory? If that is the case, you could use a plugIn for your factory, since It has application context scope.. Behind BD you can either use session or not... and the BD will use ServiceLocator singleton to lookup your JNDI objects... Hope this helps Regards marco -Original Message- From: Koon Yue Lam [mailto:[EMAIL PROTECTED] Sent: 12 July 2004 09:19 To: [EMAIL PROTECTED] Subject: Struts design problem, any help? Hi, I am very new in Struts. Can anyone give me some suggestion on the design of a Service Locator ?? I use ActionServlet as a front controller, and dispatch request to various Action, then I want all the Actions access my business tier only by the Service Locator, which return an interface of the requested service. I don't want to use session bean currently but I want my design can upgrade to session bean easily. So I think using a Service locator and return an interface of a business service is similiar to the EJBHome / EJBRemote concept. Which I can easily upgrade my application to using session bean. However how can I implement the Service Locator? Is it a POJO / Servlet / or another Struts Action ?? I try to implement it as a POJO Singleton and then share by many request, but do I need to program the multi-thread part of this POJO Service Locator by myself ?? What happen if a large number of concurrent request to that Service Locator? Any help would be appreciate Regards - 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: logging
Hi Apurva, We are having a class level variable as you mentioned as below org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(ResResourceManager.class.getName() ); I think the difference will be in the log4j.appender.R.layout.ConversionPattern=%d, [%t], %-5p, %c, - %m%n in log4jconfig.properties file. Could you please let me know log4j.appender.R.layout.ConversionPattern value ..?? Thanks, Viral -Original Message- From: Apurva Goswami [mailto:[EMAIL PROTECTED] Sent: Monday, July 12, 2004 11:50 AM To: 'Struts Users Mailing List' Subject: RE: logging Try Put these lines on top of your class file // Log4j // Log4j with Try-Catch: try {...} catch (Exception e) { cat.error(e, e); } static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance("File Name".class.getName()); E.g. static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(ResResourceManager.class.getName() ); Use these methods as per your requirement cat.debug() - > cat.debug("", e); cat.error() - > cat.error("", e); cat.fatal() - > cat.fatal("", e); It prints the method name in the log and you do not need to pass. E.g. if I use statement : if (cat.isDebugEnabled()) cat.debug("Retrieved " + agencyDepPortsDropDownList.count() + " " + countrycode + " Ports"); I get this in my log file : (CoreFareMainL:3515 initAgencyDepPortsDropDownList) - Retrieved 117 AU Ports (Class file: linenumber method ) - string message Hope it helps Cheers Apurva -Original Message- From: Viral_Thakkar [mailto:[EMAIL PROTECTED] Sent: Monday, July 12, 2004 4:03 PM To: Struts Users Mailing List Subject: logging Hi All, I am using commons-logging (using log4j) for logging.. We do following logging style... if (logger.isDebugEnabled()) { logger.debug("Method Name : + some Message"); } Here can we get the method name using java reflection or some other way so that no need to pass the method name while logging the message ..??? Regards, Viral - 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: logging
Hi Apurva, We are having a class level variable as you mentioned as below org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(ResResourceManager.class.getName() ); I think the difference will be in the log4j.appender.R.layout.ConversionPattern=%d, [%t], %-5p, %c, - %m%n in log4jconfig.properties file. Could you please let me know log4j.appender.R.layout.ConversionPattern value ..?? Thanks, Viral -Original Message- From: Apurva Goswami [mailto:[EMAIL PROTECTED] Sent: Monday, July 12, 2004 11:50 AM To: 'Struts Users Mailing List' Subject: RE: logging Try Put these lines on top of your class file // Log4j // Log4j with Try-Catch: try {...} catch (Exception e) { cat.error(e, e); } static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance("File Name".class.getName()); E.g. static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(ResResourceManager.class.getName() ); Use these methods as per your requirement cat.debug() - > cat.debug("", e); cat.error() - > cat.error("", e); cat.fatal() - > cat.fatal("", e); It prints the method name in the log and you do not need to pass. E.g. if I use statement : if (cat.isDebugEnabled()) cat.debug("Retrieved " + agencyDepPortsDropDownList.count() + " " + countrycode + " Ports"); I get this in my log file : (CoreFareMainL:3515 initAgencyDepPortsDropDownList) - Retrieved 117 AU Ports (Class file: linenumber method ) - string message Hope it helps Cheers Apurva -Original Message- From: Viral_Thakkar [mailto:[EMAIL PROTECTED] Sent: Monday, July 12, 2004 4:03 PM To: Struts Users Mailing List Subject: logging Hi All, I am using commons-logging (using log4j) for logging.. We do following logging style... if (logger.isDebugEnabled()) { logger.debug("Method Name : + some Message"); } Here can we get the method name using java reflection or some other way so that no need to pass the method name while logging the message ..??? Regards, Viral - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts design problem, any help?
Hi, I am very new in Struts. Can anyone give me some suggestion on the design of a Service Locator ?? I use ActionServlet as a front controller, and dispatch request to various Action, then I want all the Actions access my business tier only by the Service Locator, which return an interface of the requested service. I don't want to use session bean currently but I want my design can upgrade to session bean easily. So I think using a Service locator and return an interface of a business service is similiar to the EJBHome / EJBRemote concept. Which I can easily upgrade my application to using session bean. However how can I implement the Service Locator? Is it a POJO / Servlet / or another Struts Action ?? I try to implement it as a POJO Singleton and then share by many request, but do I need to program the multi-thread part of this POJO Service Locator by myself ?? What happen if a large number of concurrent request to that Service Locator? Any help would be appreciate Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to disable struts connection pooling logs
They just need to be distributed with the application - in the case of JDeveloper adding them to the project will do this - but if you are manually deploying your app just make sure those two files end up in the /WEB-INF/classes directory - You can even retro-fit them in after you've deployed if needs be. Regards Duncan Mills http://www.groundside.com/blog Veera Sivakumar wrote: Hi Duncan, I have followed your instructions. I have created two properties file exactly how you specified in your article. Then at the end the article says 'Once these properties files are configured and added to your project, the unwanted log messages will be suppressed'. How to add these to the project. Should I update struts-config.xml or web.xml with the new properties file? Can you please elaborate on this. Thanks and regards Shiva -Original Message- From: Duncan Mills [mailto:[EMAIL PROTECTED] Sent: 09 July 2004 12:23 To: Struts Users Mailing List Subject: Re: how to disable struts connection pooling logs Veera, you need to configure commons logging to control these INFO messages: I've documented what to do in a short article: http://otn.oracle.com/products/jdev/tips/mills/Struts-logging.html Regards Duncan Mills http://www.groundside.com/blog Veera Sivakumar wrote: Hi, I have web application developed on struts 1.1 , deployed on Tomcat 4.1. We use Postgres as backend database. We also use Struts connection pooling mechanism. The problem I am facing is the following entries in the stderr.log file. Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection INFO: getConnection() Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection INFO:Check for timeout, activeCount=2, useCount=0 Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection INFO:Found available connection Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection INFO:Return allocated connection, activeCount=2, useCount=1 Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource returnConnection INFO: releaseConnection(), activeCount=2, useCount=0 My log file is getting filled with these entries quickly. I want the above logs not to be written in the log file. I have kept the debug option '0' in server.xml for my app .. Also, I have modified my web.xml for my app to set the debug=0 action org.apache.struts.action.ActionServlet application qca.aps.resources.ApplicationResources config /WEB-INF/struts-config.xml debug 0 detail 0 I am still getting these logs in my log file. Can any one help me what else I have to set to stop these connection pooling entries in log file. Thanks in advance Shiva Visit our website at http://www.rm.com This message is confidential. You should not copy it or disclose its contents to anyone. You may use and apply the information only for the intended purpose. Internet communications are not secure and therefore RM does not accept legal responsibility for the contents of this message. Any views or opinions presented are only those of the author and not those of RM. If this email has come to you in error please delete it and any attachments. Please note that RM may intercept incoming and outgoing e-mail communications. This email has been scanned for viruses by Trend ScanMail. - 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]
Html Buttons & DynaValidator Forms
Hi, I am trying to implement antonio lagnada's html buttons 'pattern' (http://j2ee.lagnada.com/struts/html-buttons.htm) with DynaValidatorForms however I am have problems in the Action form when I try to interrogate the getters to find which button has been pressed. I am fairly new to struts so I may have interpreted how to implement this 'pattern' with DynaValidatorForms incorrectly, and would really appreciate some direction. here is where my problem lies ... I have my action 'AddTrainer' as follows ... public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ ActionForward forward = mapping.getInputForward(); AddTrainerForm addTrainerForm = (AddTrainerForm) form; String foo = (String)addTrainerForm.get("buttons.submit.name"); ---snip At this point it stack dumps because property buttons.submit.name doesn't exist. I have toyed with the idea of creating it as a form-property but I don't think that this is right. I understand that when submit is pressed ---snip Submit ---snip It will carry out a getButtons().getSubmit().setName("Submit") But how do I interrogate that setter when I am using dynamic forms? Here is the other bits of pertiment code ... strus-config.xml ---snip ---snip ---snip Created HtmlButton class as per example in url metioned above Created AddTrainerButtons as per example in url mentioned above {ExampleButtons.java} Modified my AddTrainerForm as follows ... public class AddTrainerForm extends DynaValidatorForm private AddTrainerButtons m_buttons = null; ---snip public void reset(ActionMapping mapping, HttpServletRequest request) { ActionServlet servlet = super.getServlet(); m_buttons = new AddTrainerButtons(); } ---snip public AddTrainerButtons getButtons() { return m_buttons; } } public void setButtons(AddTrainerButtons buttons) { m_buttons = buttons; } ---snip thanks to anybody and everybody who may be able to help my understanding of this! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]