Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

My .jsp does not call the ActionForm servlet :-(
Hello,

I have a .jsp that when opening, I feel should call the ActionForm
(holding "getters" and "setters"). But this is not going on. Is there
some place I can look to see what the problem is?

What exactly is one supposed to do so that when running a .jsp file,
the class (based on the ActionForm) will be called?

Kindest Regards.


Report this thread to moderator Post Follow-up to this message
Old Post
milkyway
12-25-04 01:56 PM


Re: My .jsp does not call the ActionForm servlet :-(
"milkyway" <d0mufasa@hotmail.com> wrote in message
news:1103978114.152877.122360@f14g2000cwb.googlegroups.com...
> Hello,
>
> I have a .jsp that when opening, I feel should call the ActionForm
> (holding "getters" and "setters"). But this is not going on. Is there
> some place I can look to see what the problem is?
>
> What exactly is one supposed to do so that when running a .jsp file,
> the class (based on the ActionForm) will be called?
>
What are you doing that you expect your JSP to "call" the ActionForm? When
you use the html:form tag (you are, right?), Struts looks at the action
attribute of the tag, matches it up to an action mapping in your
struts-config, and checks that mapping for a name attribute, which tells it
what form to use. If found, it will instantiate that ActionForm or reuse an
existing one. Does that answer your question?



Report this thread to moderator Post Follow-up to this message
Old Post
Ryan Stewart
12-25-04 08:57 PM


Re: My .jsp does not call the ActionForm servlet :-(
Hello and thank you for responding :-)

It was my understanding that when opening a .jsp file, the class that
extends ActionForm would automatically be called (to do the getters and
setters). In my case, I would like a "getter" to put some data in the
.jsp for display to the user.

I thought that the class that extends the Action servlet would be used
to guide the processing to the next step (for example another .jsp
page).

Thank you for the explanation on the action form. I suppose that I did
not define the mapping in the struts-config. One question though: Does
one ~have~ to use the "html:form" tag or tags in general when using
struts or can some just use the regular HTML tags <html> </html>

A second question: with the action attribute, I have seen something
like general.do - what is the .do for?

Kindest Regards.


Report this thread to moderator Post Follow-up to this message
Old Post
milkyway
12-25-04 08:57 PM


Re: My .jsp does not call the ActionForm servlet :-(
milkyway wrote:

> Thank you for the explanation on the action form. I suppose that I
did
> not define the mapping in the struts-config. One question though:
Does
> one ~have~ to use the "html:form" tag or tags in general when using
> struts or can some just use the regular HTML tags <html> </html>
>

Remember "html:" is the namespace. You use the <html:form> tag as a
replacement for <form> not <html> (that would be <html:html>. And yes,
you have to use the struts tag to get the autopopulation of the <form>
tag.


Report this thread to moderator Post Follow-up to this message
Old Post
Robert kebernet Cooper
12-25-04 08:57 PM


Re: My .jsp does not call the ActionForm servlet :-(
Thank you again for writing back .

But - what does the action with a ".do" do - sorry if it is common
knowledge. Or - if you could point me to documentation (easy to
understand) that says what it does that would be great
Kindest Regards.


Report this thread to moderator Post Follow-up to this message
Old Post
milkyway
12-26-04 02:01 AM


Re: My .jsp does not call the ActionForm servlet :-(
Im sure if you go to OnJava or there are some newbie struts stuff.
Basically you are looking at this:

You build an action handler java class. You put the action and form
bean defs in the struts xml file and you use the struts <html:form> tag
and <html:input whatever> stuff in you JSP and it will automatically
fill out the method signatures and pre populate the forms.


Report this thread to moderator Post Follow-up to this message
Old Post
Robert kebernet Cooper
12-26-04 02:01 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Help archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:24 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.