Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 13 Jan 2010 18:02:50 -0000 Issue 8980

user-digest-help

2010-01-13


Author LoginPost Reply

user Digest 13 Jan 2010 18:02:50 -0000 Issue 8980

Topics (messages 204606 through 204637):

Re: Displaying an image in JSP in struts+tiles project
 204606 by: Aruna Ponaka

How to use <s:param> tag
 204607 by: Aruna Ponaka
 204608 by: wild_oscar
 204610 by: Aruna Ponaka
 204611 by: Aruna Ponaka
 204618 by: Aruna Ponaka

Re: Define Global Timeout [S2]
 204609 by: Jorge Sousa
 204612 by: Gabriel Belingueres

[S2] Iterate over sessions
 204613 by: Gustavo Felisberto
 204614 by: Lukasz Lenart

[S2] Does global exception mapping work with interceptor?
 204615 by: mailtolouis2020-struts.yahoo.com
 204616 by: Gabriel Belingueres
 204628 by: mailtolouis2020-struts.yahoo.com

Can I implement interface of another project in a struts 2 project?
 204617 by: fireapple
 204621 by: Gabriel Belingueres

How struts2 supports "optgroup"?
 204619 by: Emi Lu
 204622 by: Gabriel Belingueres

Integrating with ZK
 204620 by: Rafael Taboada

Distinguish between request parameters and struts.xml parameters in Struts2
 204623 by: JOSE L MARTINEZ-AVIAL
 204624 by: Gabriel Belingueres
 204636 by: Jose Luis Martinez Avial

Struts 1.1 EL error moving to Servlet 2.4
 204625 by: Jim Kennedy

where to set 'struts.multipart.parser' property in struts2?
 204626 by: Stephen Ince
 204627 by: Lukasz Lenart
 204637 by: Stephen Ince

params not working before prepare after migration 2.1.6 to 2.1.8.1
 204629 by: David Canos
 204630 by: David Canos

[S2] Where do you place Initialization and Startup logic?
 204631 by: Greg Lindholm
 204632 by: Lukasz Lenart
 204633 by: Greg Lindholm

set-property in action-mapping in Struts 2
 204634 by: Jose Luis Martinez Avial

Re: Multiple parameters with same name in Action definition
 204635 by: Jose Luis Martinez Avial

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_204606.ezm (zipped)

I wrote an action class and it worked.
I called the action class like below...

img src="<s:url action="imgAction"></s:url>

and the struts.xml

     <action name="imgAction" class="com.icensa.action.ImageAction">        
         <result type="tiles">books</result>
    </action>


ImageAction.java


import java.io.OutputStream;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class ImageAction extends ActionSupport {
 
 private static final long serialVersionUID = 1L;
 private byte[] img=null;
 private int id = 0;
 Blob image = null;
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    byte[] imgData = null;
    OutputStream o = null;
    HttpServletResponse response = ServletActionContext.getResponse();
 
 public String execute() {
   try {
        Class.forName("com.mysql.jdbc.Driver");
       con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","test");
       stmt = con.createStatement();
       rs = stmt.executeQuery("select * from books_tb where
category='Social and Economic' order by publish_date desc");
       
       while (rs.next()) {
          image = rs.getBlob(10);
          imgData = image.getBytes(1,(int)image.length());          
      }
       
        response.setContentType("image/jpeg");
       System.out.println("id  "+getId());
        OutputStream out = response.getOutputStream();
        out.write(imgData);
        out.close();
        return null;
    }
   catch (Exception e) {
          System.out.println(e.getMessage());        
      }
   return null;
  }


I was using doDefault function earlier and was trying to return the
outputstream, but that will not work and it should return null.

Hope this is useful to someone....

--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204607.ezm (zipped)

I need to pass a parameter from JSP to Action class in a struts 2 project.

In the JSp , I have
id=1;
<s:url action= <s:param name="id" value="%{id}" /></s:url>

The ImageAction class has getId and setId method. The id value is set when I
pass the integer directly in JSP, i.e. <s:url action= <s:param name="id"
value="1" /></s:url>

but when I provide value=%{id}, it is not set, what is the correct syntax to
provide in the VALUE?


--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204608.ezm (zipped)

    <s:url id="url" action="HelloWorld">
       <s:param name="request_locale">en</s:param>
    </s:url>
    <s:a href="%{url}">English</s:a>

Aruna Ponaka wrote:
>
> what is the correct syntax to provide in the VALUE?
>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204610.ezm (zipped)


I have seen this syntax, I am not sure how to use it for my purpose. I get
id's from an sql query. I am retrieving them in a list and need to pass them
one by one to the action class. How to set them so that I can pass them as
params to the Action class? Also my code is like
<s:url action= <s:param name="id" value="16"></s:param></s:url>"
style="margin-right:20px;" />..
If i provide
<s:url id="img" action="imgAction">, it is not going to the Action class.


--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204611.ezm (zipped)

I have seen this syntax, I am not sure how to use it for my purpose. I get
id's from an sql query. I am retrieving them in a list and need to pass them
one by one to the action class. How to set them so that I can pass them as
params to the Action class? Also my code is like
img src="<s:url action="imgAction"><s:param name="id"
value="16"></s:param></s:url>" style="margin-right:20px;" />..
If i provide
<s:url id="img" action="imgAction">, it is not going to the Action class.


--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204618.ezm (zipped)

I am retrieving images from Action class onto jsp using
img src="<s:url action="imgAction">></img>

I have to pass imageid, which should be used in the Action class to return a
particular book. I am able to retrieve images but not able to pass this
value to Action class. How can I achieve this?I do not have any forms in my
JSP.
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204609.ezm (zipped)
Hi,

I can´t change the Tomcat, and i don´t think that change the Tomcat will
help me to accomplish the feature that i want.

My action does several call's to a external API, and i want to ensure
that all the call's won't exceed the time that i defined in the timeout.
Changing the Tomcat, will only works for each request, instead of the
total time of the execution of the action.

I hope this extra information is usefull to help everyone helping me :)

Thanks.

Jorge

On 11-01-2010 19:54, Brian Thompson wrote:
> Honestly, this sounds like something that should be handled at the
> application server level. What server are you using?
>
> If you're using Tomcat via the Tomcat connector, take a look at reply
> timeouts on [1].
>
> If you're not using Tomcat, I'm sure there are similar options in other app
> servers.
>
> -Brian
>
> [1] - http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html
>
>
> On Mon, Jan 11, 2010 at 12:48 PM, Jorge Sousa
> <jorge.sousa@(protected):
>
>  
>> Hi,
>>
>> First of all sorry for my bad english :)
>> I need to implement a feature in my application, that will enable me to
>> define the timeout of every request.
>> I tried to create a Interceptor and put the main thread on wait, while
>> other 2 threads, one will handle the time, and the other will make the
>> invocation.invoke(). The first of this two threads to complete, will call
>> the notify of the main thread and the correspondent result is returned.
>>
>> I tried this approach, but i get a null pointer exception in the thread
>> that tried to execute the invocation.invoke().
>>
>> Is there any suggestions?
>>
>> If some one need more explanations, please let me know.
>> You can find the code bellow.
>>
>> Thanks in advance,
>> Jorge Sousa from Portugal
>>
>> Code:
>>
>> public class TimeoutInterceptor extends AbstractInterceptor {
>>
>>   private static final ExecutorService threadPool =
>> Executors.newCachedThreadPool();
>>
>>   @Override
>>   public String intercept(ActionInvocation invocation) throws Exception {
>>      Invocator invocator = new Invocator(invocation, this);
>>      TimeoutWatcher timeoutWatcher = new TimeoutWatcher(this);
>>
>>      threadPool.execute(invocator);
>>      threadPool.execute(timeoutWatcher);
>>
>>      this.wait();
>>      if (invocator.getResult().equalsIgnoreCase("running")) {
>>         throw new TimeOutException();
>>      } else {
>>         return invocator.getResult();
>>      }
>>
>>   }
>>
>>   private class TimeoutWatcher implements Runnable {
>>
>>      private AbstractInterceptor abstractInterceptor;
>>
>>      public TimeoutWatcher(AbstractInterceptor abstractInterceptor) {
>>         this.abstractInterceptor = abstractInterceptor;
>>      }
>>
>>      @Override
>>      public void run() {
>>         try {
>>           Thread.sleep(10000);
>>         } catch (InterruptedException e) {
>>         }
>>         synchronized (abstractInterceptor) {
>>           abstractInterceptor.notify();
>>         }
>>      }
>>   }
>>
>>   private class Invocator implements Runnable {
>>
>>      private ActionInvocation invocation;
>>      private String result = "running";
>>      private AbstractInterceptor abstractInterceptor;
>>
>>      public Invocator(ActionInvocation invocation, AbstractInterceptor
>> abstractInterceptor) {
>>         this.invocation = invocation;
>>         this.abstractInterceptor = abstractInterceptor;
>>      }
>>
>>      @Override
>>      public void run() {
>>         try {
>>           result = invocation.invoke();
>>           synchronized (abstractInterceptor) {
>>              abstractInterceptor.notify();
>>           }
>>         } catch (Exception e) {
>>           result = "error";
>>         }
>>      }
>>
>>      public String getResult() {
>>         return result;
>>      }
>>   }
>>
>> }
>>
>>
>>
>>
>>
>>
>>    
>  



Attachment: user_204612.ezm (zipped)
I don't know if you can make this work.

IIRC, interceptor instances are created one by interceptor stack, so
the same instance is shared by all requests that go through that
stack. This makes the interceptor (at best) serialize all requests in
its wait-notify cycle. However, I think it is buggy since the notify()
can wake up any other waiting thread, not the one that created the 2
worker threads: you may assign a unique value to each interceptor call
to associate to the 2 workers for identifying who need to wake and who
need to go to sleep again.

Java monitors uses signal and continue semantics, so you need to
precede the wait with a while loop:
while (justAwakedThreadId != currentId) { wait() }

Also, I think you can safely replace the watchdog thread with just a
call to wait(milliseconds).

One last point to consider is what to do with the generated response,
you may want to implement certain logic inside a PreResultListener to
determine what to do?

HTH

2010/1/11 Jorge Sousa <jorge.sousa@(protected)>:
> Hi,
>
> First of all sorry for my bad english :)
> I need to implement a feature in my application, that will enable me to
> define the timeout of every request.
> I tried to create a Interceptor and put the main thread on wait, while other
> 2 threads, one will handle the time, and the other will make the
> invocation.invoke(). The first of this two threads to complete, will call
> the notify of the main thread and the correspondent result is returned.
>
> I tried this approach, but i get a null pointer exception in the thread that
> tried to execute the invocation.invoke().
>
> Is there any suggestions?
>
> If some one need more explanations, please let me know.
> You can find the code bellow.
>
> Thanks in advance,
> Jorge Sousa from Portugal
>
> Code:
>
> public class TimeoutInterceptor extends AbstractInterceptor {
>
>    private static final ExecutorService threadPool =
> Executors.newCachedThreadPool();
>
>    @(protected)
>    public String intercept(ActionInvocation invocation) throws Exception {
>        Invocator invocator = new Invocator(invocation, this);
>        TimeoutWatcher timeoutWatcher = new TimeoutWatcher(this);
>
>        threadPool.execute(invocator);
>        threadPool.execute(timeoutWatcher);
>
>        this.wait();
>        if (invocator.getResult().equalsIgnoreCase("running")) {
>            throw new TimeOutException();
>        } else {
>            return invocator.getResult();
>        }
>
>    }
>
>    private class TimeoutWatcher implements Runnable {
>
>        private AbstractInterceptor abstractInterceptor;
>
>        public TimeoutWatcher(AbstractInterceptor abstractInterceptor) {
>            this.abstractInterceptor = abstractInterceptor;
>        }
>
>        @(protected)
>        public void run() {
>            try {
>                Thread.sleep(10000);
>            } catch (InterruptedException e) {
>            }
>            synchronized (abstractInterceptor) {
>                abstractInterceptor.notify();
>            }
>        }
>    }
>
>    private class Invocator implements Runnable {
>
>        private ActionInvocation invocation;
>        private String result = "running";
>        private AbstractInterceptor abstractInterceptor;
>
>        public Invocator(ActionInvocation invocation, AbstractInterceptor
> abstractInterceptor) {
>            this.invocation = invocation;
>            this.abstractInterceptor = abstractInterceptor;
>        }
>
>        @(protected)
>        public void run() {
>            try {
>                result = invocation.invoke();
>                synchronized (abstractInterceptor) {
>                    abstractInterceptor.notify();
>                }
>            } catch (Exception e) {
>                result = "error";
>            }
>        }
>
>        public String getResult() {
>            return result;
>        }
>    }
>
> }
>
>
>
>
>
>


Attachment: user_204613.ezm (zipped)
Hello All,



I have a Web application where I handle the logged in status with some
variable in the session. I have some actions for the Administrator where we
can control if a particular user account is locked or not. My problem is
that if a user loges in and after that the admin locks the account the user
can continue to use the application until he logs out and tries to login
again.



I did not want to have to go to the database each time the user performs an
action. So when the Admin locks a user I would like to iterate over all
sessions to see if that user is logged in and force a logout.



So my question is how can I access all created sessions?



--

Gustavo Felisberto.

WIT-Software S.A.

Coimbra (Portugal), San Jose (California)

Phone: +351239801030

Web: <http://www.wit-software.com> http://www.wit-software.com




Attachment: user_204614.ezm (zipped)
You can create a class that implements HttpSessionListener [1] and
there register active user session in some global variable (bad idea).
Or create custom interceptor that will all the time verify if given
user is locked and forward him to appropriated page.

[1] http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionListener.html


Regards
--
Lukasz
Kapituła Javarsovia 2010
http://javarsovia.pl


Attachment: user_204615.ezm (zipped)
Hello,

I've defined a global exception mapping and global result, when Exception happen it will go to my custom error page. It work fine in Action if Action throw any exception. But if my interceptor throw exception, it won't go to my error page.

Is there anyway to make it work?

Thanks
LV

Attachment: user_204616.ezm (zipped)
Is your custom interceptor _before_ the exception interceptor in your
interceptor stack? If that's the case, then the exception interceptor
is not "catching" exceptions from your interceptor because it executes
after.

2010/1/12 <mailtolouis2020-struts@(protected)>:
> Hello,
>
> I've defined a global exception mapping and global result, when Exception happen it will go to my custom error page. It work fine in Action if Action throw any exception. But if my interceptor throw exception, it won't go to my error page.
>
> Is there anyway to make it work?
>
> Thanks
> LV


Attachment: user_204628.ezm (zipped)
Thanks Gabriel, it is working now!



________________________________
From: Gabriel Belingueres <belingueres@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Tue, January 12, 2010 7:06:59 PM
Subject: Re: [S2] Does global exception mapping work with interceptor?

Is your custom interceptor _before_ the exception interceptor in your
interceptor stack? If that's the case, then the exception interceptor
is not "catching" exceptions from your interceptor because it executes
after.

2010/1/12 <mailtolouis2020-struts@(protected)>:
> Hello,
>
> I've defined a global exception mapping and global result, when Exception happen it will go to my custom error page. It work fine in Action if Action throw any exception. But if my interceptor throw exception, it won't go to my error page.
>
> Is there anyway to make it work?
>
> Thanks
> LV

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

Attachment: user_204617.ezm (zipped)

In project1, I include project2 in order to use interfaces (interface A, B,
C, D.....) of project2.
However, the system always claim java.lang.NoClassDefFoundError for
interface of project2.

I also exported project2 to a JAR and include it in project1's build path,
still no luck.

I tried 3 of my projects, all fail with the same error. I was wondering if
it's a struts 2 issue of my configuration problem.

Thanks
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204621.ezm (zipped)
Seems it is not S2 related. This exception is raised when some
dependency is not found by the JVM. Note that in addition to be
available in your build path, the dependency must be available at
runtime too (usually inside the WEB-INF/lib folder)

2010/1/12 fireapple <taizhang1981@(protected)>:
>
> In project1, I include project2 in order to use interfaces (interface A, B,
> C, D.....) of project2.
> However, the system always claim java.lang.NoClassDefFoundError for
> interface of project2.
>
> I also exported project2 to a JAR and include it in project1's build path,
> still no luck.
>
> I tried 3 of my projects, all fail with the same error. I was wondering if
> it's a struts 2 issue of my configuration problem.
>
> Thanks
> --
> View this message in context: http://old.nabble.com/Can-I-implement-interface-of-another-project-in-a-struts-2-project--tp27131976p27131976.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_204619.ezm (zipped)
Good afternoon,

Could someone tell me how struts2 support "optgroup" please?

Thanks a lot!
--
Lu Ying


<select>
<optgroup label="Australia">
<option value ="sydney">Sydney</option>
<option value ="melbourne">Melbourne</option>
</optgroup>
<optgroup label="New Zealand">
<option value ="cromwell">Cromwell</option>
<option value ="queenstown">Queenstown</option>
</optgroup>
</select>


Attachment: user_204622.ezm (zipped)
http://struts.apache.org/2.1.8.1/docs/optgroup.html

2010/1/12 Emi Lu <emilu@(protected)>:
> Good afternoon,
>
> Could someone tell me how struts2 support "optgroup" please?
>
> Thanks a lot!
> --
> Lu Ying
>
>
> <select>
> <optgroup label="Australia">
> <option value ="sydney">Sydney</option>
> <option value ="melbourne">Melbourne</option>
> </optgroup>
> <optgroup label="New Zealand">
> <option value ="cromwell">Cromwell</option>
> <option value ="queenstown">Queenstown</option>
> </optgroup>
> </select>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_204620.ezm (zipped)
Hi folks,

I'm just having a review of ZK framework and I want to know if there is a
tip, tutorial, etc about how to integrate Struts 2 with ZK.

Thanks in advance

--
Rafael Taboada
Software Engineer

Cell : +511-992741026

"No creo en el destino pues no me gusta tener la idea de controlar mi vida"

Attachment: user_204623.ezm (zipped)
Distinguish between request parameters and struts.xml parameters in Struts2

Hi all,
I'm trying to distinguish the parameters that come from the request from
those that come from the params defined in the struts.xml. For example, I
have the following mapping in my struts.xml

    <action name="Login_*" method="{1}" class="example.Login">
       <param name="resource">my resource</param>
       <result name="input">/example/Login.jsp</result>
       <result type="redirectAction">Menu</result>
    </action>

The call to that action will have a variable number of parameters, so I want
to distinguish between them and the parameter defined in the struts.xml. How
can I do that? In Struts 1 I was able to use the tag <set-property>, and
since the action was separated from the form, there was no problem, but in
Struts2 that is no longer possible. Any ideas?

Thanks

Jose Luis

Attachment: user_204624.ezm (zipped)
Implement interface ParameterAware: if the "resource" key is not in
the parameter map, then the variable was set by other means than input
parameters.

2010/1/12 JOSE L MARTINEZ-AVIAL <jlmagc@(protected)>:
>  Distinguish between request parameters and struts.xml parameters in Struts2
>
> Hi all,
>  I'm trying to distinguish the parameters that come from the request from
> those that come from the params defined in the struts.xml. For example, I
> have the following mapping in my struts.xml
>
>        <action name="Login_*" method="{1}" class="example.Login">
>            <param name="resource">my resource</param>
>            <result name="input">/example/Login.jsp</result>
>            <result type="redirectAction">Menu</result>
>        </action>
>
> The call to that action will have a variable number of parameters, so I want
> to distinguish between them and the parameter defined in the struts.xml. How
> can I do that? In Struts 1 I was able to use the tag <set-property>, and
> since the action was separated from the form, there was no problem, but in
> Struts2 that is no longer possible. Any ideas?
>
> Thanks
>
> Jose Luis
>


Attachment: user_204636.ezm (zipped)
Hi all,
I'm trying to distinguish the parameters that come from the request
from those that come from the params defined in the struts.xml. For
example, I have the following mapping in my struts.xml

    <action name="Login_*" method="{1}" class="example.Login">
       <param name="resource">my resource</param>
       <result name="input">/example/Login.jsp</result>
       <result type="redirectAction">Menu</result>
    </action>

The call to that action will have a variable number of parameters, so I
want to distinguish between them and the parameter defined in the
struts.xml. How can I do that? In Struts 1 I was able to use the tag
<set-property>, and since the action was separated from the form, there
was no problem, but in Struts2 that is no longer possible. Any ideas?

Thanks

Jose Luis


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal
ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.


Attachment: user_204625.ezm (zipped)
I've had quite a few issues with EL moving from Servlet 2.3 to 2.4 (JBOSS
4.0 to 4.2). I have worked out my straight JSTL issues by changing my
taglib definitions, but my struts tags that use EL are not working
correctly. This project started out using Struts 1.1 then I added the
struts-el.jar to allow for EL in my struts tags. This all worked great
until my recent upgrade. I get the infamous message:

According to TLD or attribute directive in tag file, attribute value does
not accept any expressions.

More specifically I get:

According to TLD or attribute directive in tag file, attribute arg0 does not
accept any expressions. I get this for the following code:
<bean-el:message key="message.url"
arg0="city/savesearchform.exe?city=${city}&county=${county}&state=${state}"/
>

The details of the above don't really matter, but it is obvious that the new
version of the servlet spec I am running does not like the use of
expressions.

The old version ran under Servlet 2.3, JSTL 1.0 and JSP 1.2

The new version runs under Servlet 2.4, JSTL 1.1 and JSP 2.0

Any advice would be great. I'm hoping not to have to change my struts libs
as I am concerned about moving from 1.1 to 1.3.

Thanks



Jim Kennedy



Attachment: user_204626.ezm (zipped)
Hi,
I am using struts2 version 2.1.8.1 and I am trying to set the
struts.multipart.parser property. I can't seem to set it. I have tried
every where, one place at a time.
This is what I have tried.

WEB-INF/classes/struts.xml
  <constant name="struts.multipart.parser"
value="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequestx"
/>

WEB-INF/classes/struts.properties
  struts.multipart.parser=org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequestx

WEB-INF/classes/loadgeneral.xml <!-- my app config file -->
          <interceptor-ref name="fileUpload">
            <param name="maximumSize">10240</param>
            <param
name="parser">org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequestx</param>
            <param name="saveDir">/.deleted</param>
          </interceptor-ref>

I have also tried setting 'struts.multipart.saveDir' but that is not
being set either.
I am getting the follwing warning:
INFO: Unable to find 'struts.multipart.saveDir' property setting. Defaulting to
javax.servlet.context.tempdir

Question:
Does any have an idea of what could be the problem or where I should
set the 'struts.multipart.parser' property?
Any help would be greatly appreciated?

Steve


Attachment: user_204627.ezm (zipped)
2010/1/13 Stephen Ince <stephenpince@(protected)>:
> WEB-INF/classes/struts.xml
>    <constant name="struts.multipart.parser"
> value="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequestx"
> />

Take a look on struts-default.xml, you have to define bean and then constant

<bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest"
name="jakarta" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest"
scope="default" />

<constant name="struts.multipart.handler" value="jakarta" />


Regards
--
Lukasz
Kapituła Javarsovia 2010
http://javarsovia.pl


Attachment: user_204637.ezm (zipped)
Lukasz,
 Thx for your replay. I defined the jakartax bean but it is still
not working. Does anyone know how I can further troubleshoot this? I
can not set 'struts.multipart.saveDir' setting either. It's sees my
application include but for some reason the "struts.multipart.parser"
is not being set.
Here is my configuration. Any help would be greatly appreciated.

Steve

WEB-INF/classes/struts.xml

  <bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest"
name="jakartax"
class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequestx"
scope="default"/>
  <constant name="struts.multipart.parser" value="jakartax" />

  <constant name="struts.devMode" value="false" />
  <include file="loadgeneral.xml"/>


On Wed, Jan 13, 2010 at 2:16 AM, Lukasz Lenart
<lukasz.lenart@(protected):
> 2010/1/13 Stephen Ince <stephenpince@(protected)>:
>> WEB-INF/classes/struts.xml
>>    <constant name="struts.multipart.parser"
>> value="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequestx"
>> />
>
> Take a look on struts-default.xml, you have to define bean and then constant
>
> <bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest"
> name="jakarta" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest"
> scope="default" />
>
> <constant name="struts.multipart.handler" value="jakarta" />
>
>
> Regards
> --
> Lukasz
> Kapituła Javarsovia 2010
> http://javarsovia.pl
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_204629.ezm (zipped)
Hi folks
after migrating I cannot use paramsPrepareParams interceptorStack because
params are not being called.
I have checked setting the log to debug
log4j.logger.com.opensymphony.xwork2.interceptor=DEBUG, stdout

having no message so

any idea?

everything would be welcome

thank u :)

--
David Canós
www.david-canos.net

Attachment: user_204630.ezm (zipped)
solved!!!!
I use my own paramsPrepareParamsStack so I have to set in every package the
interceptor although I did set up in the base package.

<package...>
<default-interceptor-ref
name="yourownParamsPrepareParamsStack"></default-interceptor-ref>
...
</package>

might it be a bug?
do i issue it?


2010/1/13 David Canos <davidcanos@(protected)>

> Hi folks
> after migrating I cannot use paramsPrepareParams interceptorStack because
> params are not being called.
> I have checked setting the log to debug
> log4j.logger.com.opensymphony.xwork2.interceptor=DEBUG, stdout
>
> having no message so
>
> any idea?
>
> everything would be welcome
>
> thank u :)
>
> --
> David Canós
> www.david-canos.net
>



--
David Canós
www.david-canos.net

Attachment: user_204631.ezm (zipped)
I'm working on a new Struts 2 application and wondering where to put
startup and initialization logic?

In previous projects I've always had other servlets that were part of
the applications and would put the logic in the Servlet init() method
but I don't have a servlet this time and there is no "struts servlet"
just the filter.

I want the startup logic to run when the application starts up (tomcat
starts) or when the application gets deployed, it needs to run as
early as possible, I definitely do not want to wait for the first
action request to come in.

How do you do this?


Attachment: user_204632.ezm (zipped)
2010/1/13 Greg Lindholm <greg.lindholm@(protected)>:
> How do you do this?

ContextListener?
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContextListener.html


Regards
--
Lukasz
Kapituła Javarsovia 2010
http://javarsovia.pl


Attachment: user_204633.ezm (zipped)
Thanks, that will work.

On Wed, Jan 13, 2010 at 11:21 AM, Lukasz Lenart
<lukasz.lenart@(protected):
> 2010/1/13 Greg Lindholm <greg.lindholm@(protected)>:
>> How do you do this?
>
> ContextListener?
> http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContextListener.html
>
>
> Regards
> --
> Lukasz
> Kapituła Javarsovia 2010
> http://javarsovia.pl
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_204634.ezm (zipped)
Hi,
  In Struts 1 I was able to extend the class ActionMapping and declare
additional properties for a mapping in the struts-config.xml
<action-mappings type="MyActionMapping">

<action path="/main/index" forward="index.pantalla" scope="session">

<set-property property="publica" value="true" />

</action>

by creating the method setPublica in the class MyActionMapping. Is it
possible to do something similar in Struts 2? I've seen that there is a
param element in the DTD, but I haven't found any example of how to use
it. I want to have access to that property/param from an Interceptor.
How can I do that?

TIA

Jose Luis



Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal
ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.


Attachment: user_204635.ezm (zipped)
Hi all,
I'm trying to define an action that can be reused in multiple
definitions. They will receive a variable number of parameters from the
mapping definition

    <action name="Login_*" method="{1}" class="example.Login">
       <param name="securityParameter">value1</param>
       <param name="securityParameter">value2</param>
       <param name="securityParameter">value3</param>
       <param name="securityParameter">value4</param>
       <result name="input">/example/Login.jsp</result>
       <result type="redirectAction">Menu</result>
    </action>

So in the class I will have something like the following:

public class Login extends ExampleSupport {

private Set<String> securityParameter= new HashSet<String>();

public void setSecurityParameter(String securityParameter){
securityParameter.add(securityParameter);
}
}

What I am getting is only the last param value. Is there aniway to load
all the parameter values?

Thanks!

Jose Luis


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal
ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.

©2008 gg3721.com - Jax Systems, LLC, U.S.A.