Sounds like you have made some great progress!
Pat yourself on the back :)
Langdon Stevenson wrote:
Hi Bill
Thanks to your advice once again I have solved what was a very simple
problem. You suggestion of running the app with a debugger did the trick.
It took me long enough to get the Tomcat 4.0.6 / IDEA integration
working. Initially it wouldn't find the servlets, but would find jsps.
No idea why. In the end I just deleted Tomcat:
- Reinstalled it
- Added a mapping in the server.xml file
- Ran the web app directly to prove it worked
- Then pointed the document root at the development directory
- Compiled the application
- Triggered it from IDEA
And it just worked. The documentation on this topic is thin and
confusing for the likes of me.
I then put some break points in my JSP pages and had a look at the state
of the session object, only to find that there were _two_ session
objects. One was the object for the form (key of: student), the other
was the session object that I had been loading the data into, key of:
adamh.StudentRegistrationWizardAction.STUDENT
This is where my dilemma came from. The tutorial I had been following
was only a two step process, not a three, or more step process like
mine. It also never wrote the data back into the page, so there was no
example of pulling the data back into the JSP from a custom session Object.
So my error was to be using the wrong session object name in my JSP
pages to call the values. Being the newbie that I am I completely missed
the significance of the names and just trusted what the tutorial was
telling me.
This brings me to another issue I have with tutorials and examples. They
often re-use the same name in many places for different things. This is
fine if you are a Java god and understand what is really going on. I
don't, so I was out of luck, and blinded to the answer by the re-use of
a name that made it _look_ like things were ok.
However seeing the data in the debugger made it bleeding obvious. So I
changed the key name in the JSPs and it worked fine.
Now all is well and I can continue development. I also have the added
bonus of being able to directly test the web application without having
to continually build and deploy. This will save a significant amount of
time and trauma.
Now its back to building JWebUnit tests. My favorite pass time. I just
love seeing them all pass :-)
Regards,
Langdon
Langdon Stevenson wrote:
Hi Bill
Indeed I do have scope set to "session" in struts-config.xml. When unit
testing in debug through IDEA I can see the object in the session being
populated step by step, however when I run the compiled web app under
Struts
with JWebUnit, or a browser, I get the problem. I am up against my
limits
of debugging knowledge here :-)
I will look into more debugging and see where that takes me.
Thanks once again for your input.
Regards,
Langdon
From: "Bill Siggelkow" <[EMAIL PROTECTED]>
Are you setting scope="session" for the actions in your
struts-config.xml? If so, I'd take it through a debugger.
- Bill Siggelkow
Langdon Stevenson wrote:
Having overcome my validation problem with help from the list (thanks
Bill) I now find myself banging my head against another wall.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]