Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 2 Apr 2008 18:38:26 -0000 Issue 7957

user-digest-help

2008-04-02


Author LoginPost Reply

user Digest 2 Apr 2008 18:38:26 -0000 Issue 7957

Topics (messages 184923 through 184941):

[S2] checkboxes in each row of table - set values in action
 184923 by: lbastil

[S2] Menu Tag Library struts-config.xml problem.
 184924 by: sassien
 184930 by: Dave Newton

Regarding Service layer getting called twice
 184925 by: Prajapati Manish Narandas

application folder name in webapps folder in tomcat through struts plugin
 184926 by: Raghuveer

Re: Eclipse with struts
 184927 by: Dave Newton

Re: Use Myeclipse
 184928 by: Dave Newton

Re: Strange behavior: Trying to implement saveToken() in display actions.
 184929 by: Dave Newton
 184934 by: Doug Lochart
 184941 by: Dave Newton

struts-default.properties
 184931 by: Barron, Daniel
 184932 by: Dave Newton
 184937 by: Barron, Daniel

html:button
 184933 by: puneet duggal
 184940 by: Antonio Petrelli

How is the dependency and dependency conversion list built on struts website?
 184935 by: Griffith, Michael *
 184939 by: Griffith, Michael *

Using sets of objects with tags
 184936 by: jstraub.altec.org

Actionerrors & the Store Interceptor
 184938 by: Chris Pratt

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------

Attachment: user_184923.ezm (zipped)

Hello,

I have the following problem:

in action i have a collection of class User
each class User have different attributes, one is: boolean permission

in JSP I use struts 2 iterator tag to iterate the User Objects.
For each User entry I create one row in table.
for displaying/changing the boolean permission value I use S2 checkbox tag

so far it works fine and show all data in collection of Users correct.

But how can I set changed checkbox values (the permission attribute) back to
action?

Any help appreciated, thank you.
basti
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_184924.ezm (zipped)

Hello all,

I am used to JSF, and, trying to learn how to handle struts 2, I noticed
that there is no integrated tag to create menus (like richFaces, for
example).
So I found this library: "Struts-menu", which had initially been written for
Struts 1.
http://struts-menu.sourceforge.net/userguide.html
http://struts-menu.sourceforge.net/userguide.html
I guess you guys know it and I wonder how you made it work. I found a few
threads on this subjects but they were not really helpful for me:

according to the documentation, we have to configure the struts-config.xml
file. Ok, but I don't have any struts-config.xml file... I thought it was
not useful in struts 2.
Anyway, created one and I wrote this to reference the plugin:

<struts-config>
<plug-in className="net.sf.navigator.menu.MenuPlugIn">
<set-property property="menuConfig" value="/WEB-INF/menu-config.xml"/>
<!-- Default settings -->
</plug-in>
</struts-config>

Then I created the menu-config.xml file, with this code:

</MenuConfig>

<Displayers>
<Displayer name="TabbedMenu"
type="net.sf.navigator.displayer.TabbedMenuDisplayer"/>
</Displayers>

<Menus>
<Menu name="contactMenu" title="Contact" location="?Contact">
 <Item name="email" title="E-Mail" location="?EMail"/>
 <Item name="phone" title="Phone" location="?Phone"/>
</Menu>
</Menus>

</MenuConfig>

in summary, I did exactly what was written on the "userGuide" page. But I
still get this error that says that the menu repository could not be
obtained...
Looking on forums, I found that it could be because of a library, so I tried
to add every library included in the sample application which we can
download on the same website. Nothing helps...

By the way, this sample application does work, if I deploy it, but I cannot
find the way to make the menus work on my own project. Anyway, it seems that
this sample application is made with struts 1, so it does not really help in
my case.

I guess that I am not the only one that have or will have this problem, so
maybe someone who did it can give a summary of how to configure this library
on struts 2?

Actually, I wonder if the application considers the "struts-config.xml"
file, as it has not been referenced anywhere... I tried to add something in
the "web.xml" file to reference it, but then everything crashed, so now I
might give up... actually I would already have done it if I had found an
other menu-library ;-)

I hope someone will be able to answer my question, and I hope my text is
clear enough... :-)
regards,
sassien
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_184930.ezm (zipped)
I don't know about S2/Struts-Menu integration, but I guarantee you that
blindly following instructions for an S1 application has no chance of working
in a typical S2 application.

Dave

--- sassien <sassien@(protected):

>
> Hello all,
>
> I am used to JSF, and, trying to learn how to handle struts 2, I noticed
> that there is no integrated tag to create menus (like richFaces, for
> example).
> So I found this library: "Struts-menu", which had initially been written
> for
> Struts 1.
> http://struts-menu.sourceforge.net/userguide.html
> http://struts-menu.sourceforge.net/userguide.html
> I guess you guys know it and I wonder how you made it work. I found a few
> threads on this subjects but they were not really helpful for me:
>
> according to the documentation, we have to configure the struts-config.xml
> file. Ok, but I don't have any struts-config.xml file... I thought it was
> not useful in struts 2.
> Anyway, created one and I wrote this to reference the plugin:
>
> <struts-config>
> <plug-in className="net.sf.navigator.menu.MenuPlugIn">
>  <set-property property="menuConfig" value="/WEB-INF/menu-config.xml"/>
> <!-- Default settings -->
> </plug-in>
> </struts-config>
>
> Then I created the menu-config.xml file, with this code:
>
> </MenuConfig>
>
> <Displayers>
> <Displayer name="TabbedMenu"
> type="net.sf.navigator.displayer.TabbedMenuDisplayer"/>
> </Displayers>
>
> <Menus>
> <Menu name="contactMenu" title="Contact" location="?Contact">
>   <Item name="email" title="E-Mail" location="?EMail"/>
>   <Item name="phone" title="Phone" location="?Phone"/>
> </Menu>
> </Menus>
>
> </MenuConfig>
>
> in summary, I did exactly what was written on the "userGuide" page. But I
> still get this error that says that the menu repository could not be
> obtained...
> Looking on forums, I found that it could be because of a library, so I
> tried
> to add every library included in the sample application which we can
> download on the same website. Nothing helps...
>
> By the way, this sample application does work, if I deploy it, but I cannot
> find the way to make the menus work on my own project. Anyway, it seems
> that
> this sample application is made with struts 1, so it does not really help
> in
> my case.
>
> I guess that I am not the only one that have or will have this problem, so
> maybe someone who did it can give a summary of how to configure this
> library
> on struts 2?
>
> Actually, I wonder if the application considers the "struts-config.xml"
> file, as it has not been referenced anywhere... I tried to add something in
> the "web.xml" file to reference it, but then everything crashed, so now I
> might give up... actually I would already have done it if I had found an
> other menu-library ;-)
>
> I hope someone will be able to answer my question, and I hope my text is
> clear enough... :-)
> regards,
> sassien
> --
> View this message in context:
>
http://www.nabble.com/-S2--Menu-Tag-Library-struts-config.xml-problem.-tp16447334p16447334.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_184925.ezm (zipped)
Hi all,
i am using spring object factory action itself,service layer and Dao layer.
Here, service layer method is getting called twice and due to that dao layer
method is also called twice.
Can any body tell me what can be the reason of it?
This not happening service layer of all action.
Like i have another action class which shares the same service layer but for
that action service layer is not
getting called twice.
Following are the all configuration files:

*1. test1-applicationContext.xml* *(My application context file for that
test1 action)*

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "
http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<import resource="datasource.xml" />
<import resource="test2-applicationcontext.xml" />
<bean id="testPreview" class="net.test1">
..........
*<property name="itemListingService"> *
*<ref bean="itemListingService" /> *
*</property>*
.............
</bean>
</beans>

*2. test2-applicationcontext.xml* *(application context file which is
imported in above test1 for sharing service layer)*

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "
http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="itemListingService"
class="net.service.impl.ItemListingServiceImpl">
.................
*<property name="itemListingDao">*
*<ref bean="ItemListingDao" />*
*</property>*
.................
<property name="listingPeripheralDao">
<ref bean="listingPeripheralDao" />
</property>
.............
</bean>
</beans>

*3. struts-test1.xml (struts configuration file for test1'action)*
**
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd ">
<struts>
<package name="AuctionPreview" extends="struts-test1Stack"
namespace="/test">
 <interceptors>
  <interceptor-stack name="auctionPreviewStack">
  <interceptor-ref name="sigmaStack">
   <param name="SSLInterceptor.excludeMethods">
    showListing
   </param>
   <param name="ActionContextInterceptor.excludeMethods">
    showListing,nextAllItemList,viewStatetaxMap
   </param>
  </interceptor-ref>
  </interceptor-stack>
 </interceptors>
<default-interceptor-ref name="auctionPreviewStack" />

<action name="test!*" method="{1}" class="net.test1">
 <result>/jsp/auctionpreview/success.jsp</result>

 <result
name="success">/jsp/auctionpreview/Main.jsp?page=auctionPreview</result>
........
<result name="input">/jsp/auctionpreview/success.jsp</result>
.........
 <result
name="paymentSuccess">/jsp/listing/PaymentSuccess.jsp?page=listing</result>
 <result
name="paymentFail">/jsp/listing/PaymentFailure.jsp?page=listing</result>

 <result name="error">/jsp/listing/error.jsp?page=listing</result>
</action>
</package>
</struts>


*4.struts-test1Stack.xml (interceptor stack config file)*

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd ">
<struts>
<package name="struts-test1Stack" extends="struts-default">
<interceptors>
 <interceptor name="SSLInterceptor"
  class="net.sigmainfo.blackwells.action.SSLInterceptor" />
 <interceptor name="ActionContextInterceptor"
  class="net.sigmainfo.blackwells.action.ActionContextInterceptor" />
 <interceptor name="UrlActionInterceptor"
  class="net.sigmainfo.blackwells.action.UrlActionInterceptor" />
 ........................
 <interceptor-stack name="test1Stack">
  <interceptor-ref name="UrlActionInterceptor" />
  <interceptor-ref name="SSLInterceptor" />
  <interceptor-ref name="GarbageCollectionInterceptor" />
  <interceptor-ref name="defaultStack" />
  <interceptor-ref name="ActionContextInterceptor" />

 </interceptor-stack>
</interceptors>
Summary: Here *itemListingService(Service Layer) 's method is called twice
and because of it itemListingDao (Dao layer)'s*
*method is also called twice any it gives error like Invalid attempt to
associate collection with two open session.*
**
**
*Can anybody tell me why in test1 service layer is getting called twice.*
**
**
*Please share your ideas,*
**
*Thanx in advance.*
**
*From *
*Manish*

Attachment: user_184926.ezm (zipped)
I have done this this requirement in org.apache.struts.action.PlugIn.

Here also I am getting



public void init(ActionServlet actionServlet, ModuleConfig config) throws
ServletException {

       Properties _ini_config = new Properties();


       try {

               String
strContext=actionServlet.getServletContext().getServletContextName();

               System.out.println("strContext="+strContext);

       } catch (Exception ex) {

               System.out.println("Error !"+ex);

       }      

}      









I have HelloServlet ,HelloServletContextListener in 3 different applications
in tomcat

<tomcat_home>webapps\AppHello1
<tomcat_home>webapps\AppHello2
<tomcat_home>webapps\AppHello3

How to identify in my listner class what is the folder/context name in my
server.

public void contextInitialized(ServletContextEvent ce) {
contextName = ce.getServletContext().getServletContextName();
}


This code is working only if i have
<display-name>AppHello1</display-name> in web.xml.
If there is no <display-name> in web.xml then above code in listner class is
returning null.

Is there facility to know application folder name in webapps folder in
tomcat.




Attachment: user_184927.ezm (zipped)
--- Sam Wun <samwun2@(protected):
> Do you meant unzip the struts-xxx.zip file into the WEB-INF/lib/ folder?
> or use File->Import in Eclipse or Weblogic?

You should File->Import only the specific S2/etc. libraries you need into
WEB_INF/lib folder.

In particular do *not* import plugin libraries you're not using, as they'll
have library dependencies of their own.

Dave

Attachment: user_184928.ezm (zipped)
--- Jose Cardoso <Jose.Cardoso@(protected):
> MyEclipse would solve your problem.

Just for completeness, MyEclipse is, AFAIK, S2-unaware and would do nothing
in particular to aid in S2 development. I'm sure this will change at some
point, though.

> -----Original Message-----
> From: Sam Wun [mailto:samwun2@(protected)]
> Sent: 02 April 2008 14:17
> To: Struts Users Mailing List
> Subject: Re: Eclipse with struts
>
> ----- Original Message ----
> From: Dave Newton <newton.dave@(protected)>
> To: Struts Users Mailing List <user@(protected)>
> Sent: Wednesday, April 2, 2008 11:46:06 PM
> Subject: Re: Eclipse with struts
>
> --- Sam Wun <samwun2@(protected):
> > When I tried to follow the tutorial as shown in the following link:
> > http://www.laliluna.de/first-steps-using-struts-tutorial.html
> >
> > my newly created project in Eclipse don't have Struts libraries in the
>
> > list. What should I do to import Struts in to Eclipse?
>
> >> Start by downloading Struts and importing the libraries you need into
>
> >> your project, probably into WEB-INF/lib.
> Do you meant unzip the struts-xxx.zip file into the WEB-INF/lib/ folder?
> or use File->Import in Eclipse or Weblogic?
>
> Thanks
> Sam
>
> >> http://struts.apache.org/download.cgi#struts20111
>
> Dave


Attachment: user_184929.ezm (zipped)
--- Martin Gainty <mgainty@(protected):
> Is there any reason (other than political) why you are using 1.3.8 instead
> of 2.0.11+
> if your concerned about implement singleton servlet context then implement
> your own FilterDispatcher e.g.
>
> public class MyFilterDispatcher extends FilterDispatcher {
>
> public void setFilterConfig(FilterConfig filterConfig) {
>
> //so you can achieve this objective using ServletContextSingleton class
>      ServletContextSingleton singleton =
> ServletContextSingleton.getInstance();
>      singleton.setServletContext(filterConfig.getServletContext());

I guess I'm not sure what that has to do with an S1 token issue; could you
explain further?

Dave

> ----- Original Message -----
> From: "Doug Lochart" <dlochart@(protected)>
> To: <user@(protected)>
> Sent: Wednesday, April 02, 2008 6:43 AM
> Subject: Re: Strange behavior: Trying to implement saveToken() in display
> actions.
>
>
> > I am just learning Struts. I think I may have forgotten some
> > information that you might need in order to provide any help. I am
> > using Struts 1.3.8, JDK 1.6, running on Tomcat 5.5.
> >
> > If my problem is SO SIMPLE and hence why I have heard silence then I
> > am sorry but this is my first app and I so far what I have done looks
> > like it should work.
> >
> > Does anyone have any ideas?
> >
> > regards,
> >
> > Doug Lochart
> >
> > On Tue, Apr 1, 2008 at 2:02 PM, Doug Lochart <dlochart@(protected):
> > > I am trying to implement a pattern so that I can use struts tokens to
> > > help prevent double submission. I seem to be getting a strange
> > > sequence of events that I don't quite follow. Here is what I want to
> > > do at a high level
> > >
> > > displayCreateAccount -- forwards to --> CreateAccount.jsp (with form
> > > action defined as /createAccount)
> > > createAccount -- forwards to --> displayCreateAccountStep2 -- forwards
> > > to --> CreateAccountStep2.jsp
> > >
> > > The actions that start with 'display' merely set the struts token (e.g
> > > saveToken( request ); )
> > > Then it forwards it along to a jsp.
> > >
> > > The actions that start with 'Create' check to see if the token is
> > > valid then it processes the form submission and then
> > > forwards it to another display action which will then set the next
> > > toke for the next display of a JSP.
> > >
> > > I have checked and rechecked all of my configs but I do not see a
> > > mistake. I have also rebuilt the entire war
> > > and cleaned out EVERYTHING in Tomcat but I get the same result. When
> > > I hit the first displayCreateAccount action
> > > it properly forwards control to the jsp page that is then presented.
> > > When the form on the jsp page is submitted
> > > the displayCreateAccountStep2 action is found (see log below) in the
> > > mapping YET the original displayCreateAccount is executed. I have
> > > turned on
> > > debug of org.apache.struts. Here is my struts-config.xml and a
> > > snippet of the logs showing what is happening.
> > >
> > > I am curious as to why this is happening. I really want to understand
> > > what I am doing wrong or why it is working this way.
> > > Please let me know if I need to supply any more supporting documents.
> > >
> > > thanks
> > >
> > > Doug
> > >
> > > snippet from struts-config.xml
> > >
> > > ------------
> > >
> > >   <global-forwards>
> > >      <forward name="logon" path="/logon.do"/>
> > >      <forward name="logoff" path="/logoff.do"/>
> > >      <forward name="doubleSubmit" path="display.double.submit"/>
> > >   </global-forwards>
> > >
> > >   <action-mappings>
> > >
> > >      <action path="/displayCreateAccount"
> > >           type="capesafe.web.action.DisplayCreateAccountAction"
> > >           name="accountSetupForm"
> > >           scope="request"
> > >           cancellable="true"
> > >           validate="false">
> > >       <forward name="display1" path="display.create.account.1"/>
> > >      </action>
> > >
> > >      <action path="/createAccount"
> > >           type="capesafe.web.action.CreateAccountAction"
> > >           name="accountSetupForm"
> > >           scope="request"
> > >           cancellable="true"
> > >           input="display.create.account.1">
> > >       <forward name="success" path="/displayCreateAccountStep2"/>
> > >       <forward name="failure"
> path="/WEB-INF/common/FailedLogon.jsp"/>
> > >       <forward name="cancel"
> path="/WEB-INF/common/CancelLogon.jsp"/>
> > >      </action>
> > >
> > >      <action path="/displayCreateAccountStep2"
> > >
> type="capesafe.web.action.DisplayCreateAccountActionStep2"
> > >           name="accountSetupForm"
> > >           scope="request"
> > >           cancellable="true"
> > >           validate="false">
> > >       <forward name="displayStep2"
> path="display.create.account.2"/>
> > >      </action>
> > >
> > >      <action path="/createAccountStep2"
> > >           type="capesafe.web.action.CreateAccountActionStep2"
> > >           name="accountSetupFormStep2"
> > >           scope="request"
> > >           cancellable="true"
> > >           input="display.create.account.2">
> > >       <forward name="success" path="display.create.account.3"/>
> > >       <forward name="failure"
> path="/WEB-INF/common/FailedLogon.jsp"/>
> > >       <forward name="cancel"
> path="/WEB-INF/common/CancelLogon.jsp"/>
> > >      </action>
> > >   </action-mappings>
> > >
> > > -----------------
> > > snippet from log
> > > ------------------
> > >
> > > 42274 2008-04-01 13:38:12,979 DEBUG ModuleUtils - Get module name for
> > > path /displayCreateAccount.do
> > > 42274 2008-04-01 13:38:12,979 DEBUG ModuleUtils - Module name found:
> default
> > > 42274 2008-04-01 13:38:12,979 INFO ComposableRequestProcessor -
> > > Initializing composable request processor for module prefix ''
> > > 42274 2008-04-01 13:38:12,979 DEBUG ComposableRequestProcessor -
> > > setActionContextClassName: no className specified
> > > 42296 2008-04-01 13:38:13,001 DEBUG ComposableRequestProcessor -
> > > Using processing chain for this request
> > > 42296 2008-04-01 13:38:13,001 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.ExceptionCatcher
> > > 42296 2008-04-01 13:38:13,001 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.servlet.SelectLocale
> > > 42296 2008-04-01 13:38:13,001 DEBUG AbstractSelectLocale - retrieve
> config...
> > > 42298 2008-04-01 13:38:13,003 DEBUG AbstractSelectLocale - set
> > > context locale to en_US
> > > 42299 2008-04-01 13:38:13,004 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.servlet.SetOriginalURI
> > > 42299 2008-04-01 13:38:13,004 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.servlet.RequestNoCache
> > > 42299 2008-04-01 13:38:13,004 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.servlet.SetContentType
> > > 42299 2008-04-01 13:38:13,004 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.RemoveCachedMessages
> > > 42300 2008-04-01 13:38:13,005 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.servlet.SelectAction
> > > 42300 2008-04-01 13:38:13,005 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.servlet.AuthorizeAction
> > > 42300 2008-04-01 13:38:13,005 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.CreateActionForm
> > > 42300 2008-04-01 13:38:13,005 DEBUG CreateActionForm - Look up
> > > form-bean accountSetupForm
> > > 42303 2008-04-01 13:38:13,008 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.servlet.PopulateActionForm
> > > 42304 2008-04-01 13:38:13,009 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.servlet.ValidateActionForm
> > > 42304 2008-04-01 13:38:13,009 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.servlet.SelectInput
> > > 42304 2008-04-01 13:38:13,009 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.ExecuteCommand
> > > 42305 2008-04-01 13:38:13,010 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.servlet.SelectForward
> > > 42305 2008-04-01 13:38:13,010 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.SelectInclude
> > > 42305 2008-04-01 13:38:13,010 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.servlet.PerformInclude
> > > 42305 2008-04-01 13:38:13,010 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.servlet.CreateAction
> > > 42306 2008-04-01 13:38:13,011 INFO CreateAction - Initialize action
> > > of type: capesafe.web.action.DisplayCreateAccountAction
> > > 42309 2008-04-01 13:38:13,014 DEBUG AbstractCreateAction - setting
> > > action to capesafe.web.action.DisplayCreateAccountAction@(protected)
> > > 42309 2008-04-01 13:38:13,014 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.servlet.ExecuteAction
> > > 42309 2008-04-01 13:38:13,014 DEBUG ActionCommandBase - Executing
> > > org.apache.struts.chain.commands.ExecuteForwardCommand
> > > 42310 2008-04-01 13:38:13,015 DEBUG I18nFactorySet - Can't open file
>
=== message truncated ===


Attachment: user_184934.ezm (zipped)
> --- Martin Gainty <mgainty@(protected):
> > Is there any reason (other than political) why you are using 1.3.8 instead
> > of 2.0.11+

There are numerous reasons and one being that we are still supporting
1.x in other applications. All the books I have at my disposal deal
with 1.x. Regardless I am not asking as to which struts I should use
I am asking why I am seeing this behavior. Sorry I don't mean to
sound blunt or annoyed but I don't want this thread to get off track.

> I guess I'm not sure what that has to do with an S1 token issue; could you
> explain further?
>
> Dave

Certalnly. Maybe I should have stated it more clearly but t S1 tokens
are NOT the problem. I was trying to emphasize the pattern (for lack
of a better term) that I was trying to follow. That pattern is:

for each JSP page
1 action that is called the displayAction that sets the token and
forwards to the JSP
1 action the is the result of a form sumission from the JSP. This
will have logic and test the token and then forward
 to another displayType action that will set the next token.

I have a bug or misunderstanding most likely in my struts-config or
how this is to be really handled.
As the attached log indicates when the form submission action tries to
forward to the next display action it seems to resolve that action
from the mapping but then the display action that is actually executed
is the initial display action that displayed the same JSP.

Hope I made it more clear.

thanks for your time

Doug

>
>
> > ----- Original Message -----
> > From: "Doug Lochart" <dlochart@(protected)>
> > To: <user@(protected)>
> > Sent: Wednesday, April 02, 2008 6:43 AM
> > Subject: Re: Strange behavior: Trying to implement saveToken() in display
> > actions.
> >
> >
> > > I am just learning Struts. I think I may have forgotten some
> > > information that you might need in order to provide any help. I am
> > > using Struts 1.3.8, JDK 1.6, running on Tomcat 5.5.
> > >
> > > If my problem is SO SIMPLE and hence why I have heard silence then I
> > > am sorry but this is my first app and I so far what I have done looks
> > > like it should work.
> > >
> > > Does anyone have any ideas?
> > >
> > > regards,
> > >
> > > Doug Lochart
> > >
> > > On Tue, Apr 1, 2008 at 2:02 PM, Doug Lochart <dlochart@(protected):
> > > > I am trying to implement a pattern so that I can use struts tokens to
> > > > help prevent double submission. I seem to be getting a strange
> > > > sequence of events that I don't quite follow. Here is what I want to
> > > > do at a high level
> > > >
> > > > displayCreateAccount -- forwards to --> CreateAccount.jsp (with form
> > > > action defined as /createAccount)
> > > > createAccount -- forwards to --> displayCreateAccountStep2 -- forwards
> > > > to --> CreateAccountStep2.jsp
> > > >
> > > > The actions that start with 'display' merely set the struts token (e.g
> > > > saveToken( request ); )
> > > > Then it forwards it along to a jsp.
> > > >
> > > > The actions that start with 'Create' check to see if the token is
> > > > valid then it processes the form submission and then
> > > > forwards it to another display action which will then set the next
> > > > toke for the next display of a JSP.
> > > >
> > > > I have checked and rechecked all of my configs but I do not see a
> > > > mistake. I have also rebuilt the entire war
> > > > and cleaned out EVERYTHING in Tomcat but I get the same result. When
> > > > I hit the first displayCreateAccount action
> > > > it properly forwards control to the jsp page that is then presented.
> > > > When the form on the jsp page is submitted
> > > > the displayCreateAccountStep2 action is found (see log below) in the
> > > > mapping YET the original displayCreateAccount is executed. I have
> > > > turned on
> > > > debug of org.apache.struts. Here is my struts-config.xml and a
> > > > snippet of the logs showing what is happening.
> > > >
> > > > I am curious as to why this is happening. I really want to understand
> > > > what I am doing wrong or why it is working this way.
> > > > Please let me know if I need to supply any more supporting documents.
> > > >
> > > > thanks
> > > >
> > > > Doug
> > > >
> > > > snippet from struts-config.xml
> > > >
> > > > ------------
> > > >
> > > >   <global-forwards>
> > > >      <forward name="logon" path="/logon.do"/>
> > > >      <forward name="logoff" path="/logoff.do"/>
> > > >      <forward name="doubleSubmit" path="display.double.submit"/>
> > > >   </global-forwards>
> > > >
> > > >   <action-mappings>
> > > >
> > > >      <action path="/displayCreateAccount"
> > > >           type="capesafe.web.action.DisplayCreateAccountAction"
> > > >           name="accountSetupForm"
> > > >           scope="request"
> > > >           cancellable="true"
> > > >           validate="false">
> > > >       <forward name="display1" path="display.create.account.1"/>
> > > >      </action>
> > > >
> > > >      <action path="/createAccount"
> > > >           type="capesafe.web.action.CreateAccountAction"
> > > >           name="accountSetupForm"
> > > >           scope="request"
> > > >           cancellable="true"
> > > >           input="display.create.account.1">
> > > >       <forward name="success" path="/displayCreateAccountStep2"/>
> > > >       <forward name="failure"
> > path="/WEB-INF/common/FailedLogon.jsp"/>
> > > >       <forward name="cancel"
> > path="/WEB-INF/common/CancelLogon.jsp"/>
> > > >      </action>
> > > >
> > > >      <action path="/displayCreateAccountStep2"
> > > >
> > type="capesafe.web.action.DisplayCreateAccountActionStep2"
> > > >           name="accountSetupForm"
> > > >           scope="request"
> > > >           cancellable="true"
> > > >           validate="false">
> > > >       <forward name="displayStep2"
> > path="display.create.account.2"/>
> > > >      </action>
> > > >
> > > >      <action path="/createAccountStep2"
> > > >           type="capesafe.web.action.CreateAccountActionStep2"
> > > >           name="accountSetupFormStep2"
> > > >           scope="request"
> > > >           cancellable="true"
> > > >           input="display.create.account.2">
> > > >       <forward name="success" path="display.create.account.3"/>
> > > >       <forward name="failure"
> > path="/WEB-INF/common/FailedLogon.jsp"/>
> > > >       <forward name="cancel"
> > path="/WEB-INF/common/CancelLogon.jsp"/>
> > > >      </action>
> > > >   </action-mappings>
> > > >
> > > > -----------------
> > > > snippet from log
> > > > ------------------
> > > >
> > > > 42274 2008-04-01 13:38:12,979 DEBUG ModuleUtils - Get module name for
> > > > path /displayCreateAccount.do
> > > > 42274 2008-04-01 13:38:12,979 DEBUG ModuleUtils - Module name found:
> > default
> > > > 42274 2008-04-01 13:38:12,979 INFO ComposableRequestProcessor -
> > > > Initializing composable request processor for module prefix ''
> > > > 42274 2008-04-01 13:38:12,979 DEBUG ComposableRequestProcessor -
> > > > setActionContextClassName: no className specified
> > > > 42296 2008-04-01 13:38:13,001 DEBUG ComposableRequestProcessor -
> > > > Using processing chain for this request
> > > > 42296 2008-04-01 13:38:13,001 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.ExceptionCatcher
> > > > 42296 2008-04-01 13:38:13,001 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.servlet.SelectLocale
> > > > 42296 2008-04-01 13:38:13,001 DEBUG AbstractSelectLocale - retrieve
> > config...
> > > > 42298 2008-04-01 13:38:13,003 DEBUG AbstractSelectLocale - set
> > > > context locale to en_US
> > > > 42299 2008-04-01 13:38:13,004 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.servlet.SetOriginalURI
> > > > 42299 2008-04-01 13:38:13,004 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.servlet.RequestNoCache
> > > > 42299 2008-04-01 13:38:13,004 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.servlet.SetContentType
> > > > 42299 2008-04-01 13:38:13,004 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.RemoveCachedMessages
> > > > 42300 2008-04-01 13:38:13,005 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.servlet.SelectAction
> > > > 42300 2008-04-01 13:38:13,005 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.servlet.AuthorizeAction
> > > > 42300 2008-04-01 13:38:13,005 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.CreateActionForm
> > > > 42300 2008-04-01 13:38:13,005 DEBUG CreateActionForm - Look up
> > > > form-bean accountSetupForm
> > > > 42303 2008-04-01 13:38:13,008 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.servlet.PopulateActionForm
> > > > 42304 2008-04-01 13:38:13,009 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.servlet.ValidateActionForm
> > > > 42304 2008-04-01 13:38:13,009 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.servlet.SelectInput
> > > > 42304 2008-04-01 13:38:13,009 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.ExecuteCommand
> > > > 42305 2008-04-01 13:38:13,010 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.servlet.SelectForward
> > > > 42305 2008-04-01 13:38:13,010 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.SelectInclude
> > > > 42305 2008-04-01 13:38:13,010 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.servlet.PerformInclude
> > > > 42305 2008-04-01 13:38:13,010 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.servlet.CreateAction
> > > > 42306 2008-04-01 13:38:13,011 INFO CreateAction - Initialize action
> > > > of type: capesafe.web.action.DisplayCreateAccountAction
> > > > 42309 2008-04-01 13:38:13,014 DEBUG AbstractCreateAction - setting
> > > > action to capesafe.web.action.DisplayCreateAccountAction@(protected)
> > > > 42309 2008-04-01 13:38:13,014 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.servlet.ExecuteAction
> > > > 42309 2008-04-01 13:38:13,014 DEBUG ActionCommandBase - Executing
> > > > org.apache.struts.chain.commands.ExecuteForwardCommand
> > > > 42310 2008-04-01 13:38:13,015 DEBUG I18nFactorySet - Can't open file
> >
> === message truncated ===
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



--
What profits a man if he gains the whole world yet loses his soul?

Attachment: user_184941.ezm (zipped)
--- Doug Lochart <dlochart@(protected):
> > --- Martin Gainty <mgainty@(protected):
> > > Is there any reason (other than political) why you are using 1.3.8
> > > [Singletons? Filters?]
> > I guess I'm not sure what that has to do with an S1 token issue; could
> > you explain further?
>
> Certalnly. Maybe I should have stated it more clearly but t S1 tokens
> are NOT the problem. I was trying to emphasize the pattern (for lack
> of a better term) that I was trying to follow. That pattern is:

I actually replied to Martin, hence was asking him that question, as I was
unsure what his answer had to do with your original question.

Your question, in a nutshell, is that you're wondering why the second display
action (not the create action) is displaying the contents of the first
display? Or the initial form?

Dave


Attachment: user_184931.ezm (zipped)
It is not clear to me - is the struts-default.properties just a template
for struts.properties or is it actually being loaded? I do not see it
being loaded in anyway and only see values from struts.properties being
used. Can anyone provide some insight on this please?



Thanks in advance.



Dan Barron

Sr. SW Enginneer

SOE

dbarron@(protected)

c:619.804.4926




Attachment: user_184932.ezm (zipped)
--- "Barron, Daniel" <dbarron@(protected):
> It is not clear to me - is the struts-default.properties just a template
> for struts.properties or is it actually being loaded? I do not see it
> being loaded in anyway and only see values from struts.properties being
> used. Can anyone provide some insight on this please?

AFAIK those properties are (now, anyway) in "default.properties" in the S2
core jar and can be overridden in a struts.properties on the classpath.

That said, it's probably better to use XML constant configuration.

Dave


Attachment: user_184937.ezm (zipped)
There is no "default.properties" file in the v2.0.11.1 S2 core jar and
constants in struts.xml work but not for "struts.configuration" key it
seems.


-----Original Message-----
From: Dave Newton [mailto:newton.dave@(protected)]
Sent: Wednesday, April 02, 2008 10:44 AM
To: Struts Users Mailing List
Subject: Re: struts-default.properties

--- "Barron, Daniel" <dbarron@(protected):
> It is not clear to me - is the struts-default.properties just a
template
> for struts.properties or is it actually being loaded? I do not see it
> being loaded in anyway and only see values from struts.properties
being
> used. Can anyone provide some insight on this please?

AFAIK those properties are (now, anyway) in "default.properties" in the
S2
core jar and can be overridden in a struts.properties on the classpath.

That said, it's probably better to use XML constant configuration.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


Attachment: user_184933.ezm (zipped)
frnds how to use Simple html:button to perform action in action class
without using submit button

   
---------------------------------
Sent from Yahoo! Mail.
A Smarter Inbox.

Attachment: user_184940.ezm (zipped)
2008/4/2, puneet duggal <duggal_punit@(protected)>:
> frnds how to use Simple html:button to perform action in action class
> without using submit button

Use Javascript in the onclick attribute.

Antonio

Attachment: user_184935.ezm (zipped)
Hello all,



I think I know the answer to this, but I am wondering how the dependency
and dependency convergence lists are built on the Struts Website?

http://struts.apache.org/2.x/struts2-core/dependencies.html

http://struts.apache.org/2.x/struts2-core/dependency-convergence.html



Is this a Maven 2 feature, or is it done with something like JDepend?
I'd like to have the same information for my application using the Ant
build system.



Thanks in advance,



MG




Attachment: user_184939.ezm (zipped)
Ignore my question... I found it... Maven 2 Report, thanks.
MG

-----Original Message-----
From: Griffith, Michael * [mailto:Michael.Griffith@(protected)]
Sent: Wednesday, April 02, 2008 12:50 PM
To: Struts Users Mailing List
Subject: How is the dependency and dependency conversion list built on
struts website?

Hello all,



I think I know the answer to this, but I am wondering how the dependency
and dependency convergence lists are built on the Struts Website?

http://struts.apache.org/2.x/struts2-core/dependencies.html

http://struts.apache.org/2.x/struts2-core/dependency-convergence.html



Is this a Maven 2 feature, or is it done with something like JDepend?
I'd like to have the same information for my application using the Ant
build system.



Thanks in advance,



MG




Attachment: user_184936.ezm (zipped)
Perhaps this is the wrong place to seek help, and perhaps there is no
direct solution to my problem, but I have to try.

I am loading a simple set of objects representing users in an action; they
have names, passwords, etc., all loaded from a database.

I am displaying the elements of this set in a .jsp using the iterator tag,
creating a table of user objects with names, passwords, etc. Easy enough.

Next, I use the iterator to create textfield tags instead of property
tags, with the goal of allowing the viewer to edit all of the fields.

My problem is, how do I submit all of these fields? Understand that there
is a varying number of fields, and possibly quite a lot of them, so just
hardcoding matching setters/getters for N uniquely identified DOM tree
elements seems a poor solution.

I know I can just read in the submission stream and parse from there but I
was wondering if there is some elegant struts solution that I am missing.
If necessary I will happily provide illustrative code and links to
clarify.

Sorry again if this is not the place to pose this question, but various
forums have proved to be unresponsive. If this is the wrong place, please
let me know and I will refrain from doing so in the future.

Attachment: user_184938.ezm (zipped)
We're having a problem configuring the system and, since this seems
like a common problem, we're hoping someone has found a solution.

We have a bunch of actions that can't be run twice, so we're using the
redirect-action result type to make sure a refresh doesn't
accidentally resubmit the request. We also need to give the user a
pat on the back and let them know that things went well, so we're
setting an ActionMessage and using the store interceptor to pass the
message to the redirected page. At this point everything's working
great.

The problem comes in when an error occurs. At that point, we put
register an ActionError and forward the user back to the page they
were on to correct their error. The page displays properly, including
the error message and everything looks fine, until...

The next time you hit a page using the store interceptor in RETRIEVE
mode, you get the ActionError display since the <s:actionerror> tag
doesn't seem to clear the messages once they are displayed.

Redirecting instead of forwarding back to the page wouldn't help since
the store interceptor is already in STORE mode, it seems like the
struts tags should remove the messages once displayed so that they
wouldn't be picked up by the interceptor.

Is there a way to handle this cleanly? Thanks.
(*Chris*)
©2008 gg3721.com - Jax Systems, LLC, U.S.A.