RE: use html:form to pass the a child window to a parent window
Ok. Thank you very much. -Mensaje original- De: M Faizal [mailto:[EMAIL PROTECTED] Enviado el: viernes, 12 de mayo de 2006 5:32 Para: Struts Users Mailing List Asunto: RE: use html:form to pass the a child window to a parent window Add target attrib. in the form of your popup window ... -Original Message- From: Jos Mara Tristn [mailto:[EMAIL PROTECTED] Sent: May 11, 2006 6:33 PM To: 'Struts Users Mailing List' Subject: use html:form to pass the a child window to a parent window Hi, Sorry but I'm speak only a little english. I have two windows. the first windows call to a popup windows that gets data. When user subbmit the form this is close and the parent window show this data. First Window Name: Street: Phone:_ Open popup Popup List Name: Jhon Henry ::: Submit If I'm select Henry in the list of popup the first window show Name: Jhon. In the popup I'm forward html:form to a ActionFirstWindow.do. But this action open a new first window and not gets the data. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message has been automatically scanned for viruses - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accessing List in JSP
Sonu, Make two changes in your code, it will definitely work.. 1. Add the following line in your Action Class: request.setAttribute("myForm",myForm); 2. Modify the JSP code Hope it helps. Thanks & Regards Sunil Sahu Sonu S <[EMAIL PROTECTED]> 05/12/2006 10:27 AM Please respond to Struts Users Mailing List To user@struts.apache.org cc Subject Accessing List in JSP Hi 2 all I am using Struts 1.2 in my action class i am writing List testList = new ArrayList(); testList.add("str 1"); testList.add("str 2"); testList.add("str 3"); MyForm myForm = (MyForm) form; myForm.setMyList(testList); In Action Form i have done public class myForm extends ActionForm{ List myList; public List getMyList() { return MyList; } public void setMyList(List MyList) { this.MyList = MyList; } I want to access this List in JSP. I am trying butit is not working. I am trying Could u please tell me how to access List in JSP page Thank you With regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Accessing List in JSP
First thing you have to set your form object in either session or request by in action classs if("request".equals(mapping.getScope())) { request.setAttribute(mapping.getAttribute(),form); }else { request.getSession().setAttribute(mapping.getAttribute(), form); } And then you have to use name of your action form registered in struts-config.xml in Check out if it work and reply Regards, Sp -Original Message- From: Sonu S [mailto:[EMAIL PROTECTED] Sent: Friday, May 12, 2006 10:27 AM To: user@struts.apache.org Subject: Accessing List in JSP Hi 2 all I am using Struts 1.2 in my action class i am writing List testList = new ArrayList(); testList.add("str 1"); testList.add("str 2"); testList.add("str 3"); MyForm myForm = (MyForm) form; myForm.setMyList(testList); In Action Form i have done public class myForm extends ActionForm{ List myList; public List getMyList() { return MyList; } public void setMyList(List MyList) { this.MyList = MyList; } I want to access this List in JSP. I am trying butit is not working. I am trying Could u please tell me how to access List in JSP page Thank you With 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]
Accessing List in JSP
Hi 2 all I am using Struts 1.2 in my action class i am writing List testList = new ArrayList(); testList.add("str 1"); testList.add("str 2"); testList.add("str 3"); MyForm myForm = (MyForm) form; myForm.setMyList(testList); In Action Form i have done public class myForm extends ActionForm{ List myList; public List getMyList() { return MyList; } public void setMyList(List MyList) { this.MyList = MyList; } I want to access this List in JSP. I am trying butit is not working. I am trying Could u please tell me how to access List in JSP page Thank you With regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click)
Craig McClanahan wrote: On 5/11/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote: On 5/11/06, Craig McClanahan <[EMAIL PROTECTED]> wrote: > On 5/11/06, Jason Vincent <[EMAIL PROTECTED]> wrote: > According to the HTML specification, disabled input controls > are *not* included in the request attributes submitted to the server. > Therefore, disabling the submit button will mean that the request parameter > telling the server which button was clicked is not included Unless Javascript is used for form's data collection and submission. > I'd look for a strategy involving capturing the *second* click rather than > the first one, so you can make sure the original request is submitted with > no modifications. You mean, to resubimit the same request? What is the point? As I understand it, the goal of the exercise is to *prevent* the second submit from occurring, while still allowing the first submit to complete properly. From what I understand that is the intention. I ran into the same thing trying to use the "this.enabled = false;" bit of javascript, but I ran into the same problems as the original poster. The solution I came up with was to do something like the following (in clay): var formSubmitted = false; This will work on commandLinks as well. The javascript that JSF uses will be put after any that is specified in the onclick javascript, at least with myfaces. The only thing this doesn't do is change the way the button is displayed so it also looks disabled. But it does stop the form from being accidentally submitted by a double click. Rich - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: use html:form to pass the a child window to a parent window
Add target attrib. in the form of your popup window ... -Original Message- From: José María Tristán [mailto:[EMAIL PROTECTED] Sent: May 11, 2006 6:33 PM To: 'Struts Users Mailing List' Subject: use html:form to pass the a child window to a parent window Hi, Sorry but I'm speak only a little english. I have two windows. the first windows call to a popup windows that gets data. When user subbmit the form this is close and the parent window show this data. First Window Name: Street: Phone:_ Open popup Popup List Name: Jhon Henry ::: Submit If I'm select Henry in the list of popup the first window show Name: Jhon. In the popup I'm forward html:form to a ActionFirstWindow.do. But this action open a new first window and not gets the data. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message has been automatically scanned for viruses
Re: Browser Back Button
And I'll be contrary and toss in a "Yes, but ..." (apol: Eric Berne) (as usual, corrections to my notes are welcome) Yes, but you have to do it programmatically. I don't think there's anything in j2ee (or any other web app) interfaces or implementations that handles this, as Phil said, so you have to make it happen by using tokens and hand-written code etc etc. Unless you are progamming a bank's online faciliity or a www air traffic controller, try not to go this way (I've done one - it was fairly easy in retrospect but adds a moderately painful comprehensibility and navigation burden to the app, so I'm not advising it as a first choice). Safer to abide by available technologies and their proper application, as Phil was saying. The Back button and serverside webapps *naturally* clash if you provide no specific code to handle it - *you* have to anticipate that and program around that reality, from as early as possible in the dev cycle. Worse is that the implementation of behaviour of "Back" by different browsers is quite different, some taking the "purely snapshot" view, others taking the "resubmit the url" policy ... so there is great variation in outcomes! Unfortunately a lot of developers coming from passive web page development (where Back works perfectly every time) don't realise that there's a problem until they've completed their first decent size active serverside web app and someone (usually the customer) says "but it breaks if I click *Back*". This question was popped here a week ago ... perhaps we need an auto-responder! Rob Philihp Busby wrote: > No. > > When people have a problem with back buttons, 95% of the time they are > either doing one of the following: > - Confusing the GET and POST methods and their intended purpose with > forms. > - Abusing client-side browser scripting for forwarding users. > > On 5/11/06, temp temp <[EMAIL PROTECTED]> wrote: > >> Is there any way I can realize using java that the user >> clicked on browsers back button ? >> Thanks & Regards >> >> >> >> - >> Yahoo! Mail goes everywhere you do. Get it on your phone. >> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Browser Back Button
No. When people have a problem with back buttons, 95% of the time they are either doing one of the following: - Confusing the GET and POST methods and their intended purpose with forms. - Abusing client-side browser scripting for forwarding users. On 5/11/06, temp temp <[EMAIL PROTECTED]> wrote: Is there any way I can realize using java that the user clicked on browsers back button ? Thanks & Regards - Yahoo! Mail goes everywhere you do. Get it on your phone.
Re: How do otherS deal with being OO and dealing with multi-selects on front end?
I did (3) slightly differently - I did BeanUtils.copyProperties(formBean, Person) in the action, followed by the Helper stuff. No great difference really. I think that this is really the only feasible current mechanism for it. Rick Reumann on 11/05/06 19:13, wrote: What I ended up doing is 1) A Helper class will generate my String[] conversions to and from a List of "SomeObject" 2) My form beans stick with String[] properties for multiple selects/multibox situations 3) Rather than use BeanUtils.copyProperties( myFormBean, Person ) in my Action, I end up putting two methods in my FormBean... //PersonActionForm public void PopulatePerson( Person person ) { BeanUtils.copyProperties( person, this ); person.setDogs( Helper.populateDogsFromStringArray( this.dogIds ) ); } public void PopulateFormFromPerson( Person person ) { BeanUtils.copyProperties( this, person ); this.setDogIds( Helper.populateDogIdsFromDogs( person.getDogs() ) ); } When inserts or updates are done, all that is needed is typically an "ID" so what the Helper class methods do in building the List, of say Dogs, is just build a Dog object with only the ID populated. Of course the Person object can now still be used for retrievals when you really want it to contain complete lists of Dogs and Cats (as an example). I'm not super happy with the solution, but it works. In other option was maybe to just stuff some extra String[] array properties into the value object but that seems sort of lame. On 5/11/06, Adam Hardy <[EMAIL PROTECTED]> wrote: This is something for which I've tried to find an elegant solution on the last couple of projects I worked on. Using DTO / POJOs from Hibernate for the Person and the Cats and Dogs, I end up using a sorted set of Cats or Dogs in the page context, which I then iterate over in the JSP. This means the taglib for the checkbox / dropdown control points to the set / collection and names the methods for the label and the value: The form therefore has the dogId(s) getter and setter. However handling the submit where you have to find the Dog pojo with the chosen ID and place it in the Person.setDog() or Person.getDogs().add() is frankly complex if not downright ugly (esp if doing deletes!) There are also issues such as caching of the sets of Cats and Dogs, limiting the set where business rules apply, and internationalisation. I intend to develop my caching mechanism soon, and to refactor my ugly submit helper method to make it handle this juggling of pojos better, so as you can see I am in the same boat as you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] - JSTL Parameter Conventions
Check out Velocity and Freemarker, both are templating systems that are not tied to jsp. http://jakarta.apache.org/velocity/ http://freemarker.sourceforge.net/ I use velocity to do all of the email body templating in my applications, it works great. Dave On Thu, 2006-05-11 at 12:43 -0700, Kalcevich, Daniel wrote: > Everyone, > > > > Does anyone know of a tool or library that can be used to perform > similar operations as JSTL does with arguments like ${object.method}? I > need to build a String that has to have arguments replaced on the fly > and thought if I could find something like how JSTL does it, that it > would work for me. Thanks in advance. > > > > Daniel > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click)
On 5/11/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote: How do you know that dialog is completed? :-) By virtue of explicit transition to an end state, just like Spring WebFlow. This causes the per-dialog state information to be popped off the session-scoped statck where it is maintained, thereby freeing that state data object to be GC'd. What if a user hasn't clicked "Done" or "Cancel"? Do you have a window close event listener or something or a page change listener? An applicaton could do that kind of thing if it wanted to, or it could just let session expiration cause the clean up (which would, of course, be the default behavior anyway). Anyway, Struts Dialogs wizard sample works the same ;-) Craig
Re: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click)
On 5/11/06, Craig McClanahan <[EMAIL PROTECTED]> wrote: On 5/11/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote: > > On 5/11/06, Craig McClanahan <[EMAIL PROTECTED]> wrote: > > On 5/11/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote: > > > Also, is it possible to lock the server-side bean on a framework > > > level, so it would be guaranteed that the bean won't get second > > > request until the first one is serviced and responded to? Will a > > > simple "synchronized" do? > > > > > > Synchronizing might work *if* you were talking about the same instance > of > > the backing bean -- but that is not going to be effective if you are > using > > request scoped backing beans. In Struts terms, it would be like trying > to > > synchronize on a property setter of a request-scoped ActionForm -- that > will > > not catch the "duplicate submit" scenario because each request woud get > its > > own instance. > > Yep, I meant session-scoped beans. JSF is more tolerant to > session-scoped beans than Struts, or even prefers them over request > scoped. So this might work. Might indeed (although you would still need the server side logic to detect the second submit and ignore it somehow), but I'd likely want to have a client side solution in place too, even if I implemented this, to improve the user experience. Is it possible to put all incoming requests into the map, so after a request has been serviced (response has been returned to the browser), it is removed from the map. When another request comes, we can use either soft comparison (same base URL) or strong comparison (same URL + params + method). If the incoming request is in the map already, we wait for response and return it in the same thread as the latter request (client has abandoned the first request anyway). So, we would need a separate map-controlling thread. Incoming threads would wait on request instance in the map. When response is ready, all threads but the last one would be terminated, the last one would return the response. Um, maybe instead of a map of requests it should rather be a map with lists of similar requests... Just a thought. The point is: do not process the "same" (whatever "same" is) request until the prior one has been serviced. only store session scoped state for cases where I need it for a defined period of time (i.e. the conversational state in a Shale Dialog, for example, where it'll get thrown away for me when the dialog is completed). How do you know that dialog is completed? :-) What if a user hasn't clicked "Done" or "Cancel"? Do you have a window close event listener or something or a page change listener? Anyway, Struts Dialogs wizard sample works the same ;-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click)
On 5/11/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote: On 5/11/06, Craig McClanahan <[EMAIL PROTECTED]> wrote: > On 5/11/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote: > > Also, is it possible to lock the server-side bean on a framework > > level, so it would be guaranteed that the bean won't get second > > request until the first one is serviced and responded to? Will a > > simple "synchronized" do? > > > Synchronizing might work *if* you were talking about the same instance of > the backing bean -- but that is not going to be effective if you are using > request scoped backing beans. In Struts terms, it would be like trying to > synchronize on a property setter of a request-scoped ActionForm -- that will > not catch the "duplicate submit" scenario because each request woud get its > own instance. Yep, I meant session-scoped beans. JSF is more tolerant to session-scoped beans than Struts, or even prefers them over request scoped. So this might work. Might indeed (although you would still need the server side logic to detect the second submit and ignore it somehow), but I'd likely want to have a client side solution in place too, even if I implemented this, to improve the user experience. IMHO, session scoped backing beans in JSF have the same set of problems (as well as the same set of potential benefits) as session scoped form beans in Struts -- so the same tradeoff decisions apply in both cases. Personally, I try to use request scope for JSF backing beans (i.e. the equivalent of Action+ActionForm, or what WW2 considers to be an action instance) in my apps, and only store session scoped state for cases where I need it for a defined period of time (i.e. the conversational state in a Shale Dialog, for example, where it'll get thrown away for me when the dialog is completed). Craig
Re: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click)
On 5/11/06, Craig McClanahan <[EMAIL PROTECTED]> wrote: On 5/11/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote: > Also, is it possible to lock the server-side bean on a framework > level, so it would be guaranteed that the bean won't get second > request until the first one is serviced and responded to? Will a > simple "synchronized" do? Synchronizing might work *if* you were talking about the same instance of the backing bean -- but that is not going to be effective if you are using request scoped backing beans. In Struts terms, it would be like trying to synchronize on a property setter of a request-scoped ActionForm -- that will not catch the "duplicate submit" scenario because each request woud get its own instance. Yep, I meant session-scoped beans. JSF is more tolerant to session-scoped beans than Struts, or even prefers them over request scoped. So this might work. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] - JSTL Parameter Conventions
On 5/11/06, Kalcevich, Daniel <[EMAIL PROTECTED]> wrote: Well, I briefly looked at it. It might not be what I am looking for if I cannot use it within my Actions, and not just on the JSP. Like I said, I haven't look at it too much yet though. If you are using JSF 1.1 today, you can execute value binding and method binding expressions programmatically. Code might look something like this: FacesContext context = FacesContext.getCurrentInstance(); ValueBinding vb = context.getApplication().createValueBinding("Hello #{ customer.name} !!!"); String result = (String) vb.getValue(context); In a Java EE 5 setting (which includes JSP 2.1 and JSF 1.2), the expression language stuff has been migrated out to a separate package that can be invoked programatically using similar APIs in the javax.el package namespace, even if you're not using JSF. Daniel Craig
Re: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click)
On 5/11/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote: On 5/11/06, Craig McClanahan <[EMAIL PROTECTED]> wrote: > On 5/11/06, Jason Vincent <[EMAIL PROTECTED]> wrote: > According to the HTML specification, disabled input controls > are *not* included in the request attributes submitted to the server. > Therefore, disabling the submit button will mean that the request parameter > telling the server which button was clicked is not included Unless Javascript is used for form's data collection and submission. > I'd look for a strategy involving capturing the *second* click rather than > the first one, so you can make sure the original request is submitted with > no modifications. You mean, to resubimit the same request? What is the point? As I understand it, the goal of the exercise is to *prevent* the second submit from occurring, while still allowing the first submit to complete properly. Will not it be the same anyway? Isn't it the task of the business layer to decide what to do with the second submit (say, "add CD to the basket" then again "add CD to the basket" to make two of them, etc). Nah, I would not like that. I don't use Struts token feature for the same reason: my buseness rules may allow resubmit as "add one more". Seems that Shale (JSF?) uses Javascript anyway, Actually, it's the Command Link component that does this (i.e. when you want a hyperlink to submit the form), because there is no way to implement this at all without using JavaScript. The Command Button component (i.e. a normal submit button) does not use JavaScript. so why not to use it to collect data from the form? It will allow to make sync and async requests to be processed alike. Also, is it possible to lock the server-side bean on a framework level, so it would be guaranteed that the bean won't get second request until the first one is serviced and responded to? Will a simple "synchronized" do? Synchronizing might work *if* you were talking about the same instance of the backing bean -- but that is not going to be effective if you are using request scoped backing beans. In Struts terms, it would be like trying to synchronize on a property setter of a request-scoped ActionForm -- that will not catch the "duplicate submit" scenario because each request woud get its own instance. Craig Or maybe to somehow "swallow" all identical (up to params) requests to the same resource while the resource services the first request? Kind of like Windows "compresses" several mouse events into one. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] - JSTL Parameter Conventions
Well, I briefly looked at it. It might not be what I am looking for if I cannot use it within my Actions, and not just on the JSP. Like I said, I haven't look at it too much yet though. Daniel -Original Message- From: David Durham [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 1:41 PM To: Struts Users Mailing List Subject: Re: [OT] - JSTL Parameter Conventions Kalcevich, Daniel wrote: > Dang, I must have been spacing when I was looking on the Jakarta Site > earlier. Thanks Dave. I wasn't sure if that's what you needed or not. Good to hear that it is. -Dave - 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 Back Button
Is there any way I can realize using java that the user clicked on browsers back button ? Thanks & Regards - Yahoo! Mail goes everywhere you do. Get it on your phone.
Re: [OT] - JSTL Parameter Conventions
Kalcevich, Daniel wrote: Dang, I must have been spacing when I was looking on the Jakarta Site earlier. Thanks Dave. I wasn't sure if that's what you needed or not. Good to hear that it is. -Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] - JSTL Parameter Conventions
Dang, I must have been spacing when I was looking on the Jakarta Site earlier. Thanks Dave. Daniel -Original Message- From: David Durham [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 1:15 PM To: Struts Users Mailing List Subject: Re: [OT] - JSTL Parameter Conventions Kalcevich, Daniel wrote: > Everyone, > > Does anyone know of a tool or library that can be used to perform > similar operations as JSTL does with arguments like ${object.method}? I > need to build a String that has to have arguments replaced on the fly > and thought if I could find something like how JSTL does it, that it > would work for me. Thanks in advance. Commons-EL, right? http://jakarta.apache.org/commons/el/ -Dave - 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: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click)
On 5/11/06, Craig McClanahan <[EMAIL PROTECTED]> wrote: On 5/11/06, Jason Vincent <[EMAIL PROTECTED]> wrote: According to the HTML specification, disabled input controls are *not* included in the request attributes submitted to the server. Therefore, disabling the submit button will mean that the request parameter telling the server which button was clicked is not included Unless Javascript is used for form's data collection and submission. I'd look for a strategy involving capturing the *second* click rather than the first one, so you can make sure the original request is submitted with no modifications. You mean, to resubimit the same request? What is the point? Will not it be the same anyway? Isn't it the task of the business layer to decide what to do with the second submit (say, "add CD to the basket" then again "add CD to the basket" to make two of them, etc). Nah, I would not like that. I don't use Struts token feature for the same reason: my buseness rules may allow resubmit as "add one more". Seems that Shale (JSF?) uses Javascript anyway, so why not to use it to collect data from the form? It will allow to make sync and async requests to be processed alike. Also, is it possible to lock the server-side bean on a framework level, so it would be guaranteed that the bean won't get second request until the first one is serviced and responded to? Will a simple "synchronized" do? Or maybe to somehow "swallow" all identical (up to params) requests to the same resource while the resource services the first request? Kind of like Windows "compresses" several mouse events into one. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] - JSTL Parameter Conventions
Kalcevich, Daniel wrote: Everyone, Does anyone know of a tool or library that can be used to perform similar operations as JSTL does with arguments like ${object.method}? I need to build a String that has to have arguments replaced on the fly and thought if I could find something like how JSTL does it, that it would work for me. Thanks in advance. Commons-EL, right? http://jakarta.apache.org/commons/el/ -Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] - JSTL Parameter Conventions
Everyone, Does anyone know of a tool or library that can be used to perform similar operations as JSTL does with arguments like ${object.method}? I need to build a String that has to have arguments replaced on the fly and thought if I could find something like how JSTL does it, that it would work for me. Thanks in advance. Daniel
RE: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click)
Oh, I totally missed the point. Best of luck. -Original Message- From: Jason Vincent [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 1:21 PM To: Struts Users Mailing List Subject: Re: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click) hmmm that isn't going to solve my issue. I don't want the button disabled on reload. I only want it to be disabled from the time the user clicked the button, until the time the server is able to send back a response. Here is an example: On a login form... enter username and pwd and click the submit button. While the server is processing the login form (the IE globe is spinning) the button becomes disabled so that the user can't resubmit the same login form. I'm more curious about how setting a DOM property on a element would change the way it is handled on the server side. Thanks for the try though, Jason On 5/11/06, James Reynolds <[EMAIL PROTECTED]> wrote: > The first thought that occurs to me is, how about binding the button's > JSF 'disabled' attribute to a boolean property on your backing bean? > As part of the button's action method, you could set the boolean to > true, thereby disabling the button when the page reloads. > > > -Original Message- > From: Jason Vincent [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 11, 2006 10:42 AM > To: user@struts.apache.org > Subject: Shale: onclick="disabled='true';" not calling Action Method. > (stopping double click) > > Hi all, > > My project spec is asking me to disable form buttons once they are > clicked. It seemed easy to me, just add onclick="disabled='true'" to > the commandButton. But as anything I've found with JSF, it isn't that > easy. > > When I do this, the action method isn't being called after it passes > validation. If I remove the onclick attribute, the form works fine; > so I know it isn't a logic failure in the ViewController. > > I noticed that JSF inserts some of its own onclick logic to the button > too. So I thought I'd try to disable the button by using the onsubmit > attribute of the form tag. This also had the same behavior. > > What is going on here? Is disabling the button changing the submitted > request parameters? > > Thanks all, > Jason > > - > 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: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click)
Thanks Craig... that explains it. thanks, Jason On 5/11/06, Jason Vincent <[EMAIL PROTECTED]> wrote: hmmm that isn't going to solve my issue. I don't want the button disabled on reload. I only want it to be disabled from the time the user clicked the button, until the time the server is able to send back a response. Here is an example: On a login form... enter username and pwd and click the submit button. While the server is processing the login form (the IE globe is spinning) the button becomes disabled so that the user can't resubmit the same login form. I'm more curious about how setting a DOM property on a element would change the way it is handled on the server side. Thanks for the try though, Jason On 5/11/06, James Reynolds <[EMAIL PROTECTED]> wrote: > The first thought that occurs to me is, how about binding the button's > JSF 'disabled' attribute to a boolean property on your backing bean? As > part of the button's action method, you could set the boolean to true, > thereby disabling the button when the page reloads. > > > -Original Message- > From: Jason Vincent [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 11, 2006 10:42 AM > To: user@struts.apache.org > Subject: Shale: onclick="disabled='true';" not calling Action Method. > (stopping double click) > > Hi all, > > My project spec is asking me to disable form buttons once they are > clicked. It seemed easy to me, just add onclick="disabled='true'" to > the commandButton. But as anything I've found with JSF, it isn't that > easy. > > When I do this, the action method isn't being called after it passes > validation. If I remove the onclick attribute, the form works fine; so > I know it isn't a logic failure in the ViewController. > > I noticed that JSF inserts some of its own onclick logic to the button > too. So I thought I'd try to disable the button by using the onsubmit > attribute of the form tag. This also had the same behavior. > > What is going on here? Is disabling the button changing the submitted > request parameters? > > Thanks all, > Jason > > - > 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: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click)
hmmm that isn't going to solve my issue. I don't want the button disabled on reload. I only want it to be disabled from the time the user clicked the button, until the time the server is able to send back a response. Here is an example: On a login form... enter username and pwd and click the submit button. While the server is processing the login form (the IE globe is spinning) the button becomes disabled so that the user can't resubmit the same login form. I'm more curious about how setting a DOM property on a element would change the way it is handled on the server side. Thanks for the try though, Jason On 5/11/06, James Reynolds <[EMAIL PROTECTED]> wrote: The first thought that occurs to me is, how about binding the button's JSF 'disabled' attribute to a boolean property on your backing bean? As part of the button's action method, you could set the boolean to true, thereby disabling the button when the page reloads. -Original Message- From: Jason Vincent [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 10:42 AM To: user@struts.apache.org Subject: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click) Hi all, My project spec is asking me to disable form buttons once they are clicked. It seemed easy to me, just add onclick="disabled='true'" to the commandButton. But as anything I've found with JSF, it isn't that easy. When I do this, the action method isn't being called after it passes validation. If I remove the onclick attribute, the form works fine; so I know it isn't a logic failure in the ViewController. I noticed that JSF inserts some of its own onclick logic to the button too. So I thought I'd try to disable the button by using the onsubmit attribute of the form tag. This also had the same behavior. What is going on here? Is disabling the button changing the submitted request parameters? Thanks all, Jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do otherS deal with being OO and dealing with multi-selects on front end?
What I ended up doing is 1) A Helper class will generate my String[] conversions to and from a List of "SomeObject" 2) My form beans stick with String[] properties for multiple selects/multibox situations 3) Rather than use BeanUtils.copyProperties( myFormBean, Person ) in my Action, I end up putting two methods in my FormBean... //PersonActionForm public void PopulatePerson( Person person ) { BeanUtils.copyProperties( person, this ); person.setDogs( Helper.populateDogsFromStringArray( this.dogIds ) ); } public void PopulateFormFromPerson( Person person ) { BeanUtils.copyProperties( this, person ); this.setDogIds( Helper.populateDogIdsFromDogs( person.getDogs() ) ); } When inserts or updates are done, all that is needed is typically an "ID" so what the Helper class methods do in building the List, of say Dogs, is just build a Dog object with only the ID populated. Of course the Person object can now still be used for retrievals when you really want it to contain complete lists of Dogs and Cats (as an example). I'm not super happy with the solution, but it works. In other option was maybe to just stuff some extra String[] array properties into the value object but that seems sort of lame. On 5/11/06, Adam Hardy <[EMAIL PROTECTED]> wrote: This is something for which I've tried to find an elegant solution on the last couple of projects I worked on. Using DTO / POJOs from Hibernate for the Person and the Cats and Dogs, I end up using a sorted set of Cats or Dogs in the page context, which I then iterate over in the JSP. This means the taglib for the checkbox / dropdown control points to the set / collection and names the methods for the label and the value: The form therefore has the dogId(s) getter and setter. However handling the submit where you have to find the Dog pojo with the chosen ID and place it in the Person.setDog() or Person.getDogs().add() is frankly complex if not downright ugly (esp if doing deletes!) There are also issues such as caching of the sets of Cats and Dogs, limiting the set where business rules apply, and internationalisation. I intend to develop my caching mechanism soon, and to refactor my ugly submit helper method to make it handle this juggling of pojos better, so as you can see I am in the same boat as you. Regards Adam Rick Reumann on 10/05/06 18:12, wrote: > Lets assume you want to be a good OO developer and you are designing > an application to handle CRUD stuff for a "Person." Lets say this > Person can own Cats and Dogs. So person might look like... > > Person > -- > int personId > String personName > List dogs; //list of Dog objects > List cats; //list of Cat objects > > Your backend persistence layer of choice knows how to deal with this > Person. When it goes to insert/update a Person it knows how to update > the PersonDog and PersonCat tables with respective dog and cat ids. > > Where I always run into problems is how to best handle this kind of > stuff on the front end in Struts for multi select options (and also > using multibox with checkboxes). > > The dilemma first is "What should your PersonActionFrom hold in > relation to Cats and Dogs when all you need to capture is Dog/Cat Ids > on you form?" > > The standard practice often espoused is your ActionForm should only be > interested in capturing the inputted data - so in this case it would > be String[] catIds, String[] dogIds. This is what I'm currently > doing, but it then requires an extra conversion to convert these ids > into "Dog" and "Cat" objects so that I could pass a full "Person" > object to the backend/service layer. (You also have to convert going > back the other way as well for when you want to do an update.) > Typically I use BeanUtils to do my copying of properties from > ActionForm --> ValueObject and back the other direction as well. > Currently I'm having to use special helper covert methods that use a > combination of BeanUtils and the custom conversions for stuff like > taking a String[] dogIDs and building Dog objects from them. > > Just curious on approaches other people use and how do other > frameworks, like JSF, deal with this since they don't use ActionForms. > (For example if I have a "Person" backing bean with "Cats" and "Dogs" > in it, and my multiselect list allows me to choose dogs and cats, how > do these get updated in the backing bean. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click)
On 5/11/06, Jason Vincent <[EMAIL PROTECTED]> wrote: Hi all, My project spec is asking me to disable form buttons once they are clicked. It seemed easy to me, just add onclick="disabled='true'" to the commandButton. But as anything I've found with JSF, it isn't that easy. When I do this, the action method isn't being called after it passes validation. If I remove the onclick attribute, the form works fine; so I know it isn't a logic failure in the ViewController. I noticed that JSF inserts some of its own onclick logic to the button too. So I thought I'd try to disable the button by using the onsubmit attribute of the form tag. This also had the same behavior. AFAIK, the custom onclick code supplied by JSF is only on the *hyperlink* component (, not on the *button* component (). Are you sure you're not confusing the two? What is going on here? Is disabling the button changing the submitted request parameters? Thinking it through, yes it actually *does* change the submitted request parameters. According to the HTML specification, disabled input controls are *not* included in the request attributes submitted to the server. Therefore, disabling the submit button will mean that the request parameter telling the server which button was clicked is not included -- which means JSF can't tell which command component submitted the form -- which means it has no way to know what action to invoke. I'd look for a strategy involving capturing the *second* click rather than the first one, so you can make sure the original request is submitted with no modifications. Thanks all, Jason Craig
RE: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click)
The first thought that occurs to me is, how about binding the button's JSF 'disabled' attribute to a boolean property on your backing bean? As part of the button's action method, you could set the boolean to true, thereby disabling the button when the page reloads. -Original Message- From: Jason Vincent [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 10:42 AM To: user@struts.apache.org Subject: Shale: onclick="disabled='true';" not calling Action Method. (stopping double click) Hi all, My project spec is asking me to disable form buttons once they are clicked. It seemed easy to me, just add onclick="disabled='true'" to the commandButton. But as anything I've found with JSF, it isn't that easy. When I do this, the action method isn't being called after it passes validation. If I remove the onclick attribute, the form works fine; so I know it isn't a logic failure in the ViewController. I noticed that JSF inserts some of its own onclick logic to the button too. So I thought I'd try to disable the button by using the onsubmit attribute of the form tag. This also had the same behavior. What is going on here? Is disabling the button changing the submitted request parameters? Thanks all, Jason - 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]
Shale: onclick="disabled='true';" not calling Action Method. (stopping double click)
Hi all, My project spec is asking me to disable form buttons once they are clicked. It seemed easy to me, just add onclick="disabled='true'" to the commandButton. But as anything I've found with JSF, it isn't that easy. When I do this, the action method isn't being called after it passes validation. If I remove the onclick attribute, the form works fine; so I know it isn't a logic failure in the ViewController. I noticed that JSF inserts some of its own onclick logic to the button too. So I thought I'd try to disable the button by using the onsubmit attribute of the form tag. This also had the same behavior. What is going on here? Is disabling the button changing the submitted request parameters? Thanks all, Jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems fetching struts-config DTD
On 5/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi! I have a Struts webapp with a struts-config.xml that starts with the usual http://struts.apache.org/dtds/struts-config_1_3.dtd";> Which version of Struts are you trying to use this with? Since you are asking for version 1.3 of the DTD, then it will need to be at least some version of 1.3 before this would use an internal copy. Struts 1.2.x only supports DTD versions up through 1.2. Craig
Re: How do other deal with being OO and dealing with multselects on front end?
This is something for which I've tried to find an elegant solution on the last couple of projects I worked on. Using DTO / POJOs from Hibernate for the Person and the Cats and Dogs, I end up using a sorted set of Cats or Dogs in the page context, which I then iterate over in the JSP. This means the taglib for the checkbox / dropdown control points to the set / collection and names the methods for the label and the value: The form therefore has the dogId(s) getter and setter. However handling the submit where you have to find the Dog pojo with the chosen ID and place it in the Person.setDog() or Person.getDogs().add() is frankly complex if not downright ugly (esp if doing deletes!) There are also issues such as caching of the sets of Cats and Dogs, limiting the set where business rules apply, and internationalisation. I intend to develop my caching mechanism soon, and to refactor my ugly submit helper method to make it handle this juggling of pojos better, so as you can see I am in the same boat as you. Regards Adam Rick Reumann on 10/05/06 18:12, wrote: Lets assume you want to be a good OO developer and you are designing an application to handle CRUD stuff for a "Person." Lets say this Person can own Cats and Dogs. So person might look like... Person -- int personId String personName List dogs; //list of Dog objects List cats; //list of Cat objects Your backend persistence layer of choice knows how to deal with this Person. When it goes to insert/update a Person it knows how to update the PersonDog and PersonCat tables with respective dog and cat ids. Where I always run into problems is how to best handle this kind of stuff on the front end in Struts for multi select options (and also using multibox with checkboxes). The dilemma first is "What should your PersonActionFrom hold in relation to Cats and Dogs when all you need to capture is Dog/Cat Ids on you form?" The standard practice often espoused is your ActionForm should only be interested in capturing the inputted data - so in this case it would be String[] catIds, String[] dogIds. This is what I'm currently doing, but it then requires an extra conversion to convert these ids into "Dog" and "Cat" objects so that I could pass a full "Person" object to the backend/service layer. (You also have to convert going back the other way as well for when you want to do an update.) Typically I use BeanUtils to do my copying of properties from ActionForm --> ValueObject and back the other direction as well. Currently I'm having to use special helper covert methods that use a combination of BeanUtils and the custom conversions for stuff like taking a String[] dogIDs and building Dog objects from them. Just curious on approaches other people use and how do other frameworks, like JSF, deal with this since they don't use ActionForms. (For example if I have a "Person" backing bean with "Cats" and "Dogs" in it, and my multiselect list allows me to choose dogs and cats, how do these get updated in the backing bean. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
re: File upload using tag fails..java.lang.IllegalArgumentException:
Yeah it worked by just using the common_fileupload.jar and also by removing the commons 1.1 from all my other libs in the Websphere Appserver lib ext aswell. Thanks, Anita --- Kyle Wu <[EMAIL PROTECTED]> wrote: > as far as I know, file upload issue just require > commons-fileupload.jar which is already included in > the struts-blank demo, why don't you just do as > what is demostrated in the file upload demo? > > just a guess... > > kommineni Anita <[EMAIL PROTECTED]> д��� David, > U are right...But If I change that to post I get > java.lang.NoClassDefFoundError:org/apache/commons/io/output/DeferredFileOutputStream, > though I have the necessary jar's in place. > > Thanks, > /Anita > > --- David Evans wrote: > > > Just a guess, as i don't use the struts html tags, > > but shouldn't that > > method=get be method="post"? you can't "get" a > multi > > part form. > > > > dave > > > > - > �Ż��������-3.5G�����20M���� __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do other deal with being OO and dealing with multselects on front end?
I know exactly what you mean. What we decided on as a standard I store cats and dogs as Lists and then have getter/setter methods for Array objects which convert to/from a List on the fly. I'm not sure if this adheres to OO principles but it's serves our purpose well. Zoran > Lets assume you want to be a good OO developer and you are designing > an application to handle CRUD stuff for a "Person." Lets say this > Person can own Cats and Dogs. So person might look like... > > Person > -- > int personId > String personName > List dogs; //list of Dog objects > List cats; //list of Cat objects > > Your backend persistence layer of choice knows how to deal with this > Person. When it goes to insert/update a Person it knows how to update > the PersonDog and PersonCat tables with respective dog and cat ids. > > Where I always run into problems is how to best handle this kind of > stuff on the front end in Struts for multi select options (and also > using multibox with checkboxes). > > The dilemma first is "What should your PersonActionFrom hold in > relation to Cats and Dogs when all you need to capture is Dog/Cat Ids > on you form?" > > The standard practice often espoused is your ActionForm should only be > interested in capturing the inputted data - so in this case it would > be String[] catIds, String[] dogIds. This is what I'm currently > doing, but it then requires an extra conversion to convert these ids > into "Dog" and "Cat" objects so that I could pass a full "Person" > object to the backend/service layer. (You also have to convert going > back the other way as well for when you want to do an update.) > Typically I use BeanUtils to do my copying of properties from > ActionForm --> ValueObject and back the other direction as well. > Currently I'm having to use special helper covert methods that use a > combination of BeanUtils and the custom conversions for stuff like > taking a String[] dogIDs and building Dog objects from them. > > Just curious on approaches other people use and how do other > frameworks, like JSF, deal with this since they don't use ActionForms. > (For example if I have a "Person" backing bean with "Cats" and "Dogs" > in it, and my multiselect list allows me to choose dogs and cats, how > do these get updated in the backing bean. > > -- > Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: unable to load validation-rules.xml
hi richard, I mentioned that plugin definition in my struts-config.xml.Iam sending you the exact error which iam gettin while deployin my app in tomcat 5.5, May 10, 2006 3:40:26 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 May 10, 2006 3:40:26 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 3141 ms May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.18 May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled May 10, 2006 3:40:27 PM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) May 10, 2006 3:40:27 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\admin.xml May 10, 2006 3:40:29 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true May 10, 2006 3:40:29 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true May 10, 2006 3:40:31 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true May 10, 2006 3:40:34 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\manager.xml May 10, 2006 3:40:35 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\balancer.xml May 10, 2006 3:40:36 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /simplestruts from URL file:F:/Tomcat 5.0/webapps/simplestruts May 10, 2006 3:40:39 PM org.apache.struts.validator.ValidatorPlugIn initResources INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml' May 10, 2006 3:40:39 PM org.apache.struts.validator.ValidatorPlugIn initResources INFO: Loading validation rules file from '/WEB-INF/validation.xml' May 10, 2006 3:40:40 PM org.apache.commons.digester.Digester error SEVERE: Parse Error at line 50 column 35: Element type "va-value" must be declared. org.xml.sax.SAXParseException: Element type "va-value" must be declared. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1591) at org.apache.commons.validator.ValidatorResources.(ValidatorResources.java:159) at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237) at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3960) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4283) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:320) at org.apache.catalina.core.StandardHost.install(StandardHost.java:875) at org.apache.catalina.startup
Struts error of Default value from the server.....
I am getting this error: javax.servlet.ServletException: General error message from server: "Field 'firstname' doesn't have a default value" org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.sql.SQLException: General error message from server: "Field 'firstname' doesn't have a default value" com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1997) com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1167) com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1278) com.mysql.jdbc.Connection.execSQL(Connection.java:2247) com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1371) org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168) com.stocks.user.sql.DBSQL_RegistrationForm.execute(DBSQL_RegistrationForm.java:38) myproject1.com.RegistrationAction.execute(RegistrationAction.java:38) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) DBSQL_RegistrationForm.java: package com.stocks.user.sql; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.sql.DataSource; public class DBSQL_RegistrationForm { private static final String QUERY1 = "INSERT INTO all_users(UserName, Password) VALUES(?,?);"; private static final String QUERY2 = "CREATE TABLE ?_user_business(CompanyName VARCHAR(20), SharesHeld INT, ShareBuyingPrice FLOAT);"; private static final String QUERY3 = "CREATE TABLE ?_user_info(UserName VARCHAR(20), FName VARCHAR(20), LName VARCHAR(20), Email VARCHAR(35), Address VARCHAR(30), Phone VARCHAR(11));"; private static final String QUERY4 = "INSERT INTO ?_user_info VALUES(?,?,?,?,?,?); "; private static final String QUERY5 = "CREATE TABLE ?_SingleRecord (Balance FLOAT)"; public boolean execute(String fname, String lname, String email, String address, String phone, String UserName, String Password, DataSource ds) throws SQLException { Connection conn = null; conn = ds.getConnection(); int AccountNo = 0; //check whether user already exists or not... String QUERY = "SELECT UserName FROM all_users WHERE UserName = ? "; PreparedStatement pstmt = conn.prepareStatement(QUERY); pstmt.setString(1, UserName); ResultSet rs = pstmt.executeQuery(); if (rs.next()) return false; //user already exists... else { pstmt = conn.prepareStatement(QUERY1); pstmt.setString(1,UserName); pstmt.setString(2,Password); pstmt.addBatch(); pstmt.execute(); pstmt = conn.prepareStatement("SELECT AccountNo FROM all_users WHERE UserName = ?"); pstmt.setString(1,UserName); rs = pstmt.executeQuery(); if(rs.next()) AccountNo = rs.getInt(1); pstmt = conn.prepareStatement(QUERY2); pstmt.setInt(1,AccountNo); pstmt.execute(); pstmt = conn.prepareStatement(QUERY3); pstmt.setInt(1,AccountNo); pstmt.execute(); pstmt = conn.prepareStatement(QUERY4); pstmt.setInt(1,AccountNo); pstmt.setString(2, UserName); pstmt.setString(3, fname); pstmt.setString(4, lname); pstmt.setString(5, email); pstmt.setString(6, address); pstmt.setString(7, phone); pstmt.addBatch(); pstmt.execute(); pstmt = conn.prepareStatement(QUERY5); pstmt.setInt(1,AccountNo); pstmt.execute(); pstmt.close(); conn.close(); return true; } } } RegistrationAction.java : package myproject1.com; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.sql.DataSource; import org.apache.struts.action.ActionForm; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.stocks.user.sql.DBSQL_RegistrationForm; public class RegistrationAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { RegistrationForm myform =(RegistrationForm)form; String password= myform.getPassword(); String confirmpass= myform.getConfirmpass(); if(password.equals(confirmpass)) { String firstname= myform.getFirstName(); String lastname= myform.getLastName(); S
Re: problem while deployin
Anil, I think problem is with your validation.xml file. While doing the validation of a field (of form-bean) in validation.xml, we usually use the and element, and i think instead of writing element you have wrongly mentioned element somewhere in your validation.xml. Verify your validation.xml, it must be having wrong element name, and when container trying to verify this element against the DTD, it is giving exception. Hope it helps... Thanks & Regards Sunil Anil Kumar Pippalapalli <[EMAIL PROTECTED]> 05/11/2006 04:31 PM Please respond to Struts Users Mailing List To user@struts.apache.org cc Subject problem while deployin Hi all, I have a simple application which tries to validate user using username and password.The problem is when iam tryin to deploy application in tomcat 5.5, it gives out lots of errors. Iam furnishing the errors which i got, Any help would be appreciated, May 10, 2006 3:40:26 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 May 10, 2006 3:40:26 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 3141 ms May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.18 May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled May 10, 2006 3:40:27 PM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) May 10, 2006 3:40:27 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\admin.xml May 10, 2006 3:40:29 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true May 10, 2006 3:40:29 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true May 10, 2006 3:40:31 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true May 10, 2006 3:40:34 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\manager.xml May 10, 2006 3:40:35 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\balancer.xml May 10, 2006 3:40:36 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /simplestruts from URL file:F:/Tomcat 5.0/webapps/simplestruts May 10, 2006 3:40:39 PM org.apache.struts.validator.ValidatorPlugIn initResources INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml' May 10, 2006 3:40:39 PM org.apache.struts.validator.ValidatorPlugIn initResources INFO: Loading validation rules file from '/WEB-INF/validation.xml' May 10, 2006 3:40:40 PM org.apache.commons.digester.Digester error SEVERE: Parse Error at line 50 column 35: Element type "va-value" must be declared. org.xml.sax.SAXParseException: Element type "va-value" must be declared. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1591) at org.apache.commons.validator.ValidatorResources.(ValidatorResources.java:159) at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237) at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336) at javax.servlet.GenericServlet.init(GenericServlet.java:256)
Re: Problems fetching struts-config DTD
Niklas, I think there is nothing to do with any kind of validation. When you refer a doctype in your struts-config.xml file, it will verify it from DTD which is part of struts.jar, either you can put jar file in such a place that classloader can load it (web-inf/lib) or you can place DTD file in web-inf folder of WAR. If DTD is not available then only it will try to connect to internet. First verify that struts.jar which is loaded by classloader is having this 1.3 DTD or not. Hope it helps.. Thanks & Regards Sunil [EMAIL PROTECTED] 05/11/2006 03:31 PM Please respond to Struts Users Mailing List To user@struts.apache.org cc Subject Problems fetching struts-config DTD Hi! I have a Struts webapp with a struts-config.xml that starts with the usual http://struts.apache.org/dtds/struts-config_1_3.dtd";> So when the web application is started Struts goes out to struts.apache.org to try to fetch the DTD file. This is becoming a problem since the Internet can't be reached from all environments that the web application is going to run in. What is the preferred way to handle this? Can you turn of validation so Struts never tries to fetch the DTD file? I have tried to add an init-param validating=false to web.xml (also tried validate=true) but that didn't seem to help. Can you put the DTD file locally womewhere inside the webapp and reference it in a way so that it works regardless of the environment? Thanks for any help! /Niklas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems fetching struts-config DTD
U could use a classpath entity resolver and put the dtd in a jar on the path -Original Message- From: A. Alonso Dominguez [mailto:[EMAIL PROTECTED] Sent: 11 May 2006 11:25 To: Struts Users Mailing List Subject: Re: Problems fetching struts-config DTD Take a look to the possible configurations of commons-digester, the ActionServlet fallsback to that library when it loads all the struts-config.xml files for your webapp. A working solution is to remove the DOCTYPE reference in the xml files. Alonso 2006/5/11, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > Hi! > > I have a Struts webapp with a struts-config.xml that starts with the usual > > > >"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" > "http://struts.apache.org/dtds/struts-config_1_3.dtd";> > > So when the web application is started Struts goes out to > struts.apache.org to try to fetch the DTD file. This is becoming a problem > since the Internet can't be reached from all environments that the web > application is going to run in. > > What is the preferred way to handle this? > > Can you turn of validation so Struts never tries to fetch the DTD file? I > have tried to add an init-param validating=false to web.xml (also tried > validate=true) but that didn't seem to help. > > Can you put the DTD file locally womewhere inside the webapp and reference > it in a way so that it works regardless of the environment? > > Thanks for any help! > > /Niklas > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > The Northgate IS Content Screening and Inspection system has scanned this message for malicious and inappropriate content and none was found. Please take care when opening attachments even when these are expected and from known and trusted sources. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: problem while deployin
Check ur validation file INFO: Loading validation rules file from '/WEB-INF/validation.xml' May 10, 2006 3:40:40 PM org.apache.commons.digester.Digester error SEVERE: Parse Error at line 50 column 35: Element type "va-value" must be declared. org.xml.sax.SAXParseException: Element type "va-value" must be declared. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) -Original Message- From: Patil, Sheetal [mailto:[EMAIL PROTECTED] Sent: 11 May 2006 12:08 To: Struts Users Mailing List Subject: RE: problem while deployin Hay u havent mention what is this "va-value" -Original Message- From: Anil Kumar Pippalapalli [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 4:32 PM To: user@struts.apache.org Subject: problem while deployin Hi all, I have a simple application which tries to validate user using username and password.The problem is when iam tryin to deploy application in tomcat 5.5, it gives out lots of errors. Iam furnishing the errors which i got, Any help would be appreciated, May 10, 2006 3:40:26 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 May 10, 2006 3:40:26 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 3141 ms May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.18 May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled May 10, 2006 3:40:27 PM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) May 10, 2006 3:40:27 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\admin.xml May 10, 2006 3:40:29 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true May 10, 2006 3:40:29 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true May 10, 2006 3:40:31 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true May 10, 2006 3:40:34 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\manager.xml May 10, 2006 3:40:35 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\balancer.xml May 10, 2006 3:40:36 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /simplestruts from URL file:F:/Tomcat 5.0/webapps/simplestruts May 10, 2006 3:40:39 PM org.apache.struts.validator.ValidatorPlugIn initResources INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml' May 10, 2006 3:40:39 PM org.apache.struts.validator.ValidatorPlugIn initResources INFO: Loading validation rules file from '/WEB-INF/validation.xml' May 10, 2006 3:40:40 PM org.apache.commons.digester.Digester error SEVERE: Parse Error at line 50 column 35: Element type "va-value" must be declared. org.xml.sax.SAXParseException: Element type "va-value" must be declared. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unkno wn Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis patcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno wn Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1591) at org.apache.commons.validator.ValidatorResources.(ValidatorResource s.java:159) at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugI n.java:237) at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:16 2) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.j ava:869) at org.apache.struts.actio
RE: problem while deployin
Hay u havent mention what is this "va-value" -Original Message- From: Anil Kumar Pippalapalli [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 4:32 PM To: user@struts.apache.org Subject: problem while deployin Hi all, I have a simple application which tries to validate user using username and password.The problem is when iam tryin to deploy application in tomcat 5.5, it gives out lots of errors. Iam furnishing the errors which i got, Any help would be appreciated, May 10, 2006 3:40:26 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 May 10, 2006 3:40:26 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 3141 ms May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.18 May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled May 10, 2006 3:40:27 PM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) May 10, 2006 3:40:27 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\admin.xml May 10, 2006 3:40:29 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true May 10, 2006 3:40:29 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true May 10, 2006 3:40:31 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true May 10, 2006 3:40:34 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\manager.xml May 10, 2006 3:40:35 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\balancer.xml May 10, 2006 3:40:36 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /simplestruts from URL file:F:/Tomcat 5.0/webapps/simplestruts May 10, 2006 3:40:39 PM org.apache.struts.validator.ValidatorPlugIn initResources INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml' May 10, 2006 3:40:39 PM org.apache.struts.validator.ValidatorPlugIn initResources INFO: Loading validation rules file from '/WEB-INF/validation.xml' May 10, 2006 3:40:40 PM org.apache.commons.digester.Digester error SEVERE: Parse Error at line 50 column 35: Element type "va-value" must be declared. org.xml.sax.SAXParseException: Element type "va-value" must be declared. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unkno wn Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis patcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno wn Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1591) at org.apache.commons.validator.ValidatorResources.(ValidatorResource s.java:159) at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugI n.java:237) at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:16 2) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.j ava:869) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav a:1044) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j ava:3960) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4283 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja va:866) at org.apache.catalina.core.Cont
problem while deployin
Hi all, I have a simple application which tries to validate user using username and password.The problem is when iam tryin to deploy application in tomcat 5.5, it gives out lots of errors. Iam furnishing the errors which i got, Any help would be appreciated, May 10, 2006 3:40:26 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 May 10, 2006 3:40:26 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 3141 ms May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.18 May 10, 2006 3:40:26 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled May 10, 2006 3:40:27 PM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) May 10, 2006 3:40:27 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\admin.xml May 10, 2006 3:40:29 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true May 10, 2006 3:40:29 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true May 10, 2006 3:40:31 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true May 10, 2006 3:40:34 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\manager.xml May 10, 2006 3:40:35 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\Tomcat 5.0\conf\Catalina\localhost\balancer.xml May 10, 2006 3:40:36 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /simplestruts from URL file:F:/Tomcat 5.0/webapps/simplestruts May 10, 2006 3:40:39 PM org.apache.struts.validator.ValidatorPlugIn initResources INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml' May 10, 2006 3:40:39 PM org.apache.struts.validator.ValidatorPlugIn initResources INFO: Loading validation rules file from '/WEB-INF/validation.xml' May 10, 2006 3:40:40 PM org.apache.commons.digester.Digester error SEVERE: Parse Error at line 50 column 35: Element type "va-value" must be declared. org.xml.sax.SAXParseException: Element type "va-value" must be declared. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1591) at org.apache.commons.validator.ValidatorResources.(ValidatorResources.java:159) at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237) at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3960) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4283) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:3
use html:form to pass the a child window to a parent window
Hi, Sorry but I'm speak only a little english. I have two windows. the first windows call to a popup windows that gets data. When user subbmit the form this is close and the parent window show this data. First Window Name: Street: Phone:_ Open popup Popup List Name: Jhon Henry ::: Submit If I'm select Henry in the list of popup the first window show Name: Jhon. In the popup I'm forward html:form to a ActionFirstWindow.do. But this action open a new first window and not gets the data. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems fetching struts-config DTD
Take a look to the possible configurations of commons-digester, the ActionServlet fallsback to that library when it loads all the struts-config.xml files for your webapp. A working solution is to remove the DOCTYPE reference in the xml files. Alonso 2006/5/11, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: Hi! I have a Struts webapp with a struts-config.xml that starts with the usual http://struts.apache.org/dtds/struts-config_1_3.dtd";> So when the web application is started Struts goes out to struts.apache.org to try to fetch the DTD file. This is becoming a problem since the Internet can't be reached from all environments that the web application is going to run in. What is the preferred way to handle this? Can you turn of validation so Struts never tries to fetch the DTD file? I have tried to add an init-param validating=false to web.xml (also tried validate=true) but that didn't seem to help. Can you put the DTD file locally womewhere inside the webapp and reference it in a way so that it works regardless of the environment? Thanks for any help! /Niklas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts and WebServices with both FORM and BASIC authentication in same web app
Frank, thanks for the response. I was afraid that was going to be the answer. /robert Frank W. Zammetti wrote: Robert Taylor wrote: Greetings, can you have both FORM and BASIC authentication in the same web application? (I don't think so, but thought I would ask) No, you cannot. I recently asked this same question... just look at the web-app DTD... at least in 2.3, auth-method is marked as ? affinity. I have a system of Struts web applications where I have users authenticating using FORM based authentication. I also have a need for B-to-B communication between these applications and with external applications. I would like to use Axis2 for remoting and would like to secure these web services using BASIC authentication over HTTPS. I had an identical situation. I wound up using IBM's WS engine built into Websphere, since we are a Websphere shop... interestingly, this is just a version of Axis anyway! They deal with this issue though. Before I did that though, I had a proof-of-concept using a filter to the basic auth check, simulate basic auth in reality. The difference is that instead of request-challenge-validate as the cycle, the incoming WS request is required to container ID/PW with it, so I skip directly to the validate step. This has to be a common problem and was wondering if anyone had cracked this nut yet? I've found examples of doing one or the other, but NOT BOTH at the same time on the same web application. I too would like to know how others have solved this problem. It's nice when the app server has the capability built-in as Websphere does, but I'm interested in how it can be done in the absence of that. /robert Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems fetching struts-config DTD
Hi! I have a Struts webapp with a struts-config.xml that starts with the usual http://struts.apache.org/dtds/struts-config_1_3.dtd";> So when the web application is started Struts goes out to struts.apache.org to try to fetch the DTD file. This is becoming a problem since the Internet can't be reached from all environments that the web application is going to run in. What is the preferred way to handle this? Can you turn of validation so Struts never tries to fetch the DTD file? I have tried to add an init-param validating=false to web.xml (also tried validate=true) but that didn't seem to help. Can you put the DTD file locally womewhere inside the webapp and reference it in a way so that it works regardless of the environment? Thanks for any help! /Niklas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Basic
Hi, If you are using logic equal , you should also use logic not equal. Regards, Nagesh -Original Message- From: siva sajja [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 12:08 PM To: Struts Users Mailing List Subject: Re: Basic wrote: > > Greetings everyone: > > Objective: Retrieve an object from the session that contains a > Collection of String for userRoles. Iterate through userRoles, and if > one of the roles equals "SUPER" include a href. > > > So this is what I have, but doesn't seem to be correct: > > > > name="<%=LookupConstants.SESSION_OBJECT%>" > property="userRoles" scope="session"> > > > test > > > > . > > Note: I can get the session value just fine, when i do the following: >scope="session" /> > Can you please let me know what I'm doing wrong within the iterte block? > > > - > Get amazing travel prices for air and hotel in one click on Yahoo! > FareChase > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
General error message from server : "Field 'firstname' doesn't have a default value"
javax.servlet.ServletException: General error message from server: "Field 'firstname' doesn't have a default value" org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.sql.SQLException: General error message from server: "Field 'firstname' doesn't have a default value" com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1997) com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1167) com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1278) com.mysql.jdbc.Connection.execSQL(Connection.java:2247) com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1371) org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168) com.stocks.user.sql.DBSQL_RegistrationForm.execute(DBSQL_RegistrationForm.java:38) myproject1.com.RegistrationAction.execute(RegistrationAction.java:38) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) DBSQL_RegistrationForm.java: package com.stocks.user.sql; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.sql.DataSource; public class DBSQL_RegistrationForm { private static final String QUERY1 = "INSERT INTO all_users(UserName, Password) VALUES(?,?);"; private static final String QUERY2 = "CREATE TABLE ?_user_business(CompanyName VARCHAR(20), SharesHeld INT, ShareBuyingPrice FLOAT);"; private static final String QUERY3 = "CREATE TABLE ?_user_info(UserName VARCHAR(20), FName VARCHAR(20), LName VARCHAR(20), Email VARCHAR(35), Address VARCHAR(30), Phone VARCHAR(11));"; private static final String QUERY4 = "INSERT INTO ?_user_info VALUES(?,?,?,?,?,?); "; private static final String QUERY5 = "CREATE TABLE ?_SingleRecord (Balance FLOAT)"; public boolean execute(String fname, String lname, String email, String address, String phone, String UserName, String Password, DataSource ds) throws SQLException { Connection conn = null; conn = ds.getConnection(); int AccountNo = 0; //check whether user already exists or not... String QUERY = "SELECT UserName FROM all_users WHERE UserName = ? "; PreparedStatement pstmt = conn.prepareStatement(QUERY); pstmt.setString(1, UserName); ResultSet rs = pstmt.executeQuery(); if (rs.next()) return false; //user already exists... else { pstmt = conn.prepareStatement(QUERY1); pstmt.setString(1,UserName); pstmt.setString(2,Password); pstmt.addBatch(); pstmt.execute(); pstmt = conn.prepareStatement("SELECT AccountNo FROM all_users WHERE UserName = ?"); pstmt.setString(1,UserName); rs = pstmt.executeQuery(); if(rs.next()) AccountNo = rs.getInt(1); pstmt = conn.prepareStatement(QUERY2); pstmt.setInt(1,AccountNo); pstmt.execute(); pstmt = conn.prepareStatement(QUERY3); pstmt.setInt(1,AccountNo); pstmt.execute(); pstmt = conn.prepareStatement(QUERY4); pstmt.setInt(1,AccountNo); pstmt.setString(2, UserName); pstmt.setString(3, fname); pstmt.setString(4, lname); pstmt.setString(5, email); pstmt.setString(6, address); pstmt.setString(7, phone); pstmt.addBatch(); pstmt.execute(); pstmt = conn.prepareStatement(QUERY5); pstmt.setInt(1,AccountNo); pstmt.execute(); pstmt.close(); conn.close(); return true; } } } RegistrationAction.java : package myproject1.com; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.sql.DataSource; import org.apache.struts.action.ActionForm; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.stocks.user.sql.DBSQL_RegistrationForm; public class RegistrationAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { RegistrationForm myform =(RegistrationForm)form; String password= myform.getPassword(); String confirmpass= myform.getConfirmpass(); if(password.equals(confirmpass)) { String firstname= myform.getFirstName(); String lastname= myform.getLastName(); String addr= myform.getAddr();