You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andy Kriger <ak...@greaterthanone.com> on 2002/09/17 17:42:31 UTC

refreshing application properties

I have a webapp running under Resin using Struts. I am storing message
strings and SQL queries in an application properties file. I have a class
that extends Action. It does...
MessageResources messages=getResources();
String msg = messages.getMessage("myString");

I would like to be able to make changes to the properties file while the
appserver is running and have the changes be used by my classes and JSPs
(w/o having to restart the appserver). However, when I make these changes
and then reload the page, these changes are not propogated to the class or
the JSP that uses the class. I have tried removing all java & class files
generated from compiling the JSPs from the work/_web directory but that did
not work.

Has anyone had any experience doing this?
Apologies if this is Resin-related, not Struts-related.

thx
andy



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


UML representation of Struts Action

Posted by alex hun <ji...@singnet.com.sg>.
hi all,

    Currently, my project team is working on the software architecture document
and design document for our project.  However, we are uncertain of the way the
how the various actions are to be represented in UML for the sequence diagram in
other not to clutter the diagram too much.  Our peer project team uses struts
config to symbolically represents the various actions.  This seems to be a good
approach as certain action like the CRUD functions are more or less similar, and
it makes no sense to have them represented as a seperate flow.  Moreover, a good
overall view can be easily shown. Nonetheless, my team would still like to know
if there are  any current standards or reference for representing the various
actions in UML sequence diagram.  thanks.

regards
alex



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Newbie Questions

Posted by James Mitchell <jm...@telocity.com>.
> -----Original Message-----
> From: Vipul Sagare [mailto:vipul_sagare@yahoo.com]
> Sent: Tuesday, September 17, 2002 11:45 AM
> To: Struts Users Mailing List
> Subject: Newbie Questions
>
>
> Do I have to have a separate ActionForm bean for every HTML form?

No, the ActionForms are specified as:
<form-bean name="whatever"...

and you use them with:
<action    path="/someUrl"
               type="my.action.class.SomethingAction"
               name="whatever"
              scope="request"
              input="logon">
      <forward name="success"  path="/somepage.jsp"/>
</action>

You can create another action and use the "whatever" form again.



> Can I use other beans or hashmaps with ActionForms?
>

You can use any object you want, as long as the accessors follow standard
JavaBeans pattern.
Keep in mind what Craig says about needing to redisplay incorrectly entered
data from the users end.  If a user types in 22 for their age, struts can
set 22 in a nested object that requires an int, long, or wrapper of either.
But if the user enters 'twenty two', then it will not be added and if you
are validating it, when the page gets redisplayed, it won't say 'twenty
two', it will just be blank, or you might have a nice stack trace for them
to look at.

Search the archives, this is a pretty regular topic.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://www.open-tools.org/struts-atlanta



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Newbie Questions

Posted by Vipul Sagare <vi...@yahoo.com>.

Do I have to have a separate ActionForm bean for every HTML form? 
Can I use other beans or hashmaps with ActionForms? 


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: refreshing application properties

Posted by Michael Lee <ml...@hotmail.com>.
Just peruse the javadocs for ResourceBundle (and similar classes). You will
see static finals all over the place. It has to be re-class loaded is my
guess. Just redeploy the WAR.
Mike

----- Original Message -----
From: "Eddie Bush" <ek...@swbell.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, September 17, 2002 12:07 PM
Subject: Re: refreshing application properties


> That doesn't just go for MessageResources -- it goes for all of your
> entire web-app config.  Once the configuration has been frozen, any
> attempt to modify it will meet with an exception being thrown.
>
> Regards,
>
> Eddie
>
> James Mitchell wrote:
>
> >I could be wrong, but every thing I've seen tell me that you can't do
this
> >with the current MessageResources API.  There is no call for reloading or
> >even modifying values.
> >
> >I've written a DBMessageResources, and working on XMLMessageResources,
there
> >seems to be an cache issue, so (currently) I am not able to modify a
value
> >in the database and see the change on the web page, unless the session
> >expires and the user gets a new one.
> >
> >You'll probably want to roll your own and add it as a plugin.....but then
> >this will require changes to your code (undesireable from a component
add-on
> >standpoint).
> >
> >Good luck and let me know if you find anything.
> >
> >
> >
> >James Mitchell
> >Software Engineer\Struts Evangelist
> >Struts-Atlanta, the "Open Minded Developer Network"
> >http://www.open-tools.org/struts-atlanta
> >
>
> --
> Eddie Bush
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: refreshing application properties

Posted by Eddie Bush <ek...@swbell.net>.
That doesn't just go for MessageResources -- it goes for all of your 
entire web-app config.  Once the configuration has been frozen, any 
attempt to modify it will meet with an exception being thrown.

Regards,

Eddie

James Mitchell wrote:

>I could be wrong, but every thing I've seen tell me that you can't do this
>with the current MessageResources API.  There is no call for reloading or
>even modifying values.
>
>I've written a DBMessageResources, and working on XMLMessageResources, there
>seems to be an cache issue, so (currently) I am not able to modify a value
>in the database and see the change on the web page, unless the session
>expires and the user gets a new one.
>
>You'll probably want to roll your own and add it as a plugin.....but then
>this will require changes to your code (undesireable from a component add-on
>standpoint).
>
>Good luck and let me know if you find anything.
>
>
>
>James Mitchell
>Software Engineer\Struts Evangelist
>Struts-Atlanta, the "Open Minded Developer Network"
>http://www.open-tools.org/struts-atlanta
>

-- 
Eddie Bush




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: refreshing application properties

Posted by James Mitchell <jm...@telocity.com>.
I could be wrong, but every thing I've seen tell me that you can't do this
with the current MessageResources API.  There is no call for reloading or
even modifying values.

I've written a DBMessageResources, and working on XMLMessageResources, there
seems to be an cache issue, so (currently) I am not able to modify a value
in the database and see the change on the web page, unless the session
expires and the user gets a new one.

You'll probably want to roll your own and add it as a plugin.....but then
this will require changes to your code (undesireable from a component add-on
standpoint).

Good luck and let me know if you find anything.



James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://www.open-tools.org/struts-atlanta




> -----Original Message-----
> From: Andy Kriger [mailto:akriger@greaterthanone.com]
> Sent: Tuesday, September 17, 2002 11:43 AM
> To: Struts Users Mailing List
> Subject: refreshing application properties
>
>
> I have a webapp running under Resin using Struts. I am storing message
> strings and SQL queries in an application properties file. I have a class
> that extends Action. It does...
> MessageResources messages=getResources();
> String msg = messages.getMessage("myString");
>
> I would like to be able to make changes to the properties file while the
> appserver is running and have the changes be used by my classes and JSPs
> (w/o having to restart the appserver). However, when I make these changes
> and then reload the page, these changes are not propogated to the class or
> the JSP that uses the class. I have tried removing all java & class files
> generated from compiling the JSPs from the work/_web directory
> but that did
> not work.
>
> Has anyone had any experience doing this?
> Apologies if this is Resin-related, not Struts-related.
>
> thx
> andy
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>