You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dan Connelly <ds...@adelphia.net> on 2001/02/16 13:36:17 UTC

Blank Newbie (on Tomcat)

Here is a solution, not a problem !

I recently posted to the struts-dev list that the new application, struts-blank, should include a blank form to be submitted, that I had trouble when I tried to add even the simplest form (although the un-edited application worked OK).  I suspected that I was making some Newbie mistake putting the form together.  I was.

Should you also have trouble with this, the Newbie problem (my problem, now solved) is that you must re-deploy the application if you make a change to the struts-config.xml.   (Is this obvious?  It wasn't to me.   In fact, the splash screen on struts-blank implies otherwise.)

The splash screen on struts-blank tells you that you can just edit, seemingly everything, seemingly after deployment, while Tomcat is running..  

Yes.  You can do this for index.jsp.  It works.  No problem.  So you press on.

You can also write the code and add your BlankForm class and your BlankAction class in situ to /WEB-INF/classes while Tomcat is running.   No problem.

However, when you edit struts-config.xml (as you must do to incorporate the BlankForm and the BlankAction into the application), then you must re-deploy.  (Well, its slightly easier on Tomcat.) 

The struts-config.xml is ingested on deployment, not whenever index.jsp runs (as a Newbie might suppose).  However, on Tomcat you can still edit struts-config.xml in situ, instead of remaking the WAR, which you could also do.   But, in either case, you must shutdown and (re) startup Tomcat to get have your changes to struts-config.xml made effective.  (J2EE platforms allow dynamic deployment.)



Re: Blank Newbie (on Tomcat)

Posted by Ted Husted <ne...@husted.com>.
> Dan Connelly wrote:
> Should you also have trouble with this, the Newbie problem (my
> problem, now solved) is that you must re-deploy the application if you
> make a change to the struts-config.xml.   (Is this obvious?  It wasn't
> to me.   In fact, the splash screen on struts-blank implies
> otherwise.)

The index.jsp says 

"To get started on your own application, rename struts-blank.war to the
name for your application, and let your container auto-deploy it. Edit
the blank configuration files as needed, and you are on your way! (You
can find the ApplicationResources file with this message in the classes
folder.)"

Do you think that changing that to 

"To get started on your own application, copy the struts-blank.war to a
new WAR file using the name for your application. Place it in your
container's "webapp" folder (or equivalent), and let your container
auto-deploy the application. Edit the skeleton configuration files as
needed, reload Struts or restart your container, and you are on your
way! (You can find the ApplicationResources file with this message in
the classes folder.)"

-Ted.