Re: session based pojo as form variables

2008-10-14 Thread 928572663
Thank you Gabriel. It wasn't exactly what I was hoping for, but at least I know that will not work as I expected. Thanks, John Gabriel Belingueres wrote: Because the textfield name is actually firstName, and because you don't have a setFirstName(String) method in your action, the parameter

Re: session based pojo as form variables

2008-10-10 Thread Gabriel Belingueres
Because the textfield name is actually firstName, and because you don't have a setFirstName(String) method in your action, the parameter is never set. Either you have to: 1) write without the s:push, or 2) if you are more comfortable writing the form field names without all the "formBean.", your a

Re: session based pojo as form variables

2008-10-10 Thread 928572663
Hello again. Still having problems with this one. The page displays the default values, but when I submit, the updated values aren't getting copied into the session form bean. If I remove the tag and just reference each field independently it works ok. But when is added back into the JS

Re: session based pojo as form variables

2008-09-22 Thread 928572663
Ok I figured out what is happening with my method="pageForward" > attempt: If you specify a form action function (example, action="sample!submit") it will supersede your 's method parameter and the method will not get called. If I remove the "!submit" and make it action="sample" then the m

Re: session based pojo as form variables

2008-09-21 Thread Jim Kiley
On Sat, Sep 20, 2008 at 4:46 PM, 928572663 <[EMAIL PROTECTED]> wrote: > > The Tag Reference doc: > > http://struts.apache.org/2.0.11.1/docs/submit.html > > doesn't have much detail about what to expect: "Set method attribute." Is > my pageForward() method supposed to conform to a certain signatu

Re: session based pojo as form variables

2008-09-20 Thread 928572663
Dave Newton wrote: I'll consider writing up a summary of the various ways to accomplish what you're trying to do and putting it on the wiki, although most of it will be an aggregation of info that's already there. Thank you But I havent' seen anything in the framework yet on how to have a

Re: session based pojo as form variables

2008-09-20 Thread Gabriel Belingueres
928572663 I can not disagree more with you. First we can not have the whole picture of your problem because only you are in front of your screen and your system, so we just make an educated guessing, so the more information you supply, the better. You didn't supply your struts.xml file for example

Re: session based pojo as form variables

2008-09-20 Thread Dave Newton
Moving back to the list. --- On Sat, 9/20/08, 928572663 <[EMAIL PROTECTED]> wrote: > If you believe that your suggestions are correct, then please > modify my samples, test them, and email them back to me. Sure, if you wash my dishes and break down a bunch of empty boxes and put them into my sto

Re: session based pojo as form variables

2008-09-20 Thread Gabriel Belingueres
1) Again, replace the names of your form fields: from: to: 2) SessionAware interface: it is pointless to implement it if you are not going to save the session Map in an instance variable for future reference, and if getting the session through Map session = (Map)ActionContext.getContext().get("s

Re: session based pojo as form variables

2008-09-19 Thread Dave Newton
As was mentioned to you previously, at the very least you shouldn't use "#session..." as the name; you should just use "session" if you've implemented a getSession() method. That may be enough; can't test at the moment. Dave --- On Fri, 9/19/08, 928572663 <[EMAIL PROTECTED]> wrote: > I am using

Re: session based pojo as form variables

2008-09-19 Thread 928572663
I am using Zero Configuration (annotations), so no struts.xml necessary. formDetails.jsp "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> <%@ page contentType="text/html;charset=UTF-8" language="java"%> <%@ taglib prefix="s" uri="/struts-tags"%>

Re: session based pojo as form variables

2008-09-19 Thread Gabriel Belingueres
Could you post your struts.xml, action and (one of the) JSP? 2008/9/19 928572663 <[EMAIL PROTECTED]>: > It's still not working - same error. > > I tried to revert my JSP back to using the #session.formBean syntax, and > now at least I am able to see my default values in the form again. > > But wh

Re: session based pojo as form variables

2008-09-19 Thread 928572663
It's still not working - same error. I tried to revert my JSP back to using the #session.formBean syntax, and now at least I am able to see my default values in the form again. But when I submit the form with changes, the framework calls my Action's setSession() function, but the data val

Re: session based pojo as form variables

2008-09-17 Thread Gabriel Belingueres
You need to instantiate your formBean before the interceptor stack tries to set the parameters. Common points in your code where you can accomplish that are: instantiating the object when declared as an instance variable, inside a constructor of your action, or implement the Preparable interface an

Re: session based pojo as form variables

2008-09-17 Thread 928572663
I tried both suggestions and neither worked. The first thing I tried was to implement the getter/setters and change the JSP as you suggested. When I did this I got the following: Caused by: ognl.OgnlException: formBean [java.lang.NullPointerException] at ognl.OgnlRuntime.getMethodVal

Re: session based pojo as form variables

2008-09-17 Thread Gabriel Belingueres
I've never used a form field name like "#session.formBean.firstName" before, but if you refactor your code a little: Make your action implement SessionAware interface and put a formBean getter/setter in your actions (or some superclass of your wizard actions), which takes it from the session: publ

Re: session based pojo as form variables

2008-09-17 Thread 928572663
Here are some examples of how I am accessing the session pojo fields on my form: and then in my action class (SampleAction): public String showForm() throws Exception { MyFormBean formBean = new MyFormBean(); Map session = (Map)ActionContext.getContext().get("session");

Re: session based pojo as form variables

2008-09-16 Thread Dave Newton
--- On Tue, 9/16/08, John Norvell wrote: > Is there simple answer to this? I can include some code > snippets if necessary. Necessary ;) There's no way to know what your form is storing its values to w/o seeing the action and what it's exposing to the JSP. Dave -

session based pojo as form variables

2008-09-16 Thread John Norvell
Hi, I'm new to struts2 and old with struts 1.x. My application is 99% wizards using session based form beans. I'm trying to write my own simple struts2 test app with a single form, single action, and a pojo valueobj saved in session. The action has 2 functions: one to create the pojo and