Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 7 Feb 2008 12:34:44 -0000 Issue 7852

user-digest-help

2008-02-07


Author LoginPost Reply

user Digest 7 Feb 2008 12:34:44 -0000 Issue 7852

Topics (messages 182326 through 182349):

Re: Losing Session Attributes
 182326 by: Musachy Barroso
 182327 by: Dave Newton

file upload problems
 182328 by: manub

html:hidden as a collection not String
 182329 by: Shanna7463

Re: STRUTS 2: fail to retrieve values without repost
 182330 by: Musachy Barroso
 182337 by: Nushi

Re: Problem s:select in IE and Firefox
 182331 by: Jeromy Evans
 182332 by: Martin Gainty

STRUTS 2: File tag problem
 182333 by: Srikanth Muthyala
 182334 by: mgainty.hotmail.com
 182348 by: Srikanth Muthyala

Re: How can I validate a composed object in my action?(Struts 2)
 182335 by: Vamsi Gmail!

struts polish application
 182336 by: Raghuveer
 182342 by: Nuwan Chandrasoma
 182347 by: Piotr Falenczyk

Struts2 sesionExpired page
 182338 by: jignesh.patel
 182341 by: Nuwan Chandrasoma
 182345 by: Okan Özeren

Re: [STRUTS2] Error in Dojo / Howto update Dojo
 182339 by: Shantur Rathore

Struts2 + FCKEditor
 182340 by: Shantur Rathore

[Struts2.011] Best approach for limited view
 182343 by: lbastil

Do you know ?
 182344 by: Jose Cardoso
 182349 by: Antonio Petrelli

Struts2, collection of objects and JSP
 182346 by: Piotr Falenczyk

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_182326.ezm (zipped)
I forgot to say, after trying everything, you can add an
HttpSessionAttributeListener to your application and see when the
value is nulled out/replaced.

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionAttributeListener.html

musachy

On Feb 6, 2008 12:25 PM, Musachy Barroso <musachy@(protected):
> Is the value in the session null or an empty map? If it is an empty
> map, the reason might be that when you set the value in the session
> between requests, the request doesn't have any parameters, setting the
> value to an empty map.
>
> musachy
>
>
> On Feb 6, 2008 11:55 AM, daveck <deck@(protected):
> >
> > In case I wasn't clear... the attribute "PARMS" exists but loses it value.
> > --
> > View this message in context: http://www.nabble.com/Losing-Session-Attributes-tp15298791p15307254.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)
> >
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment: user_182327.ezm (zipped)
--- daveck <deck@(protected):
> > Try making a copy of the request parameter map and storing that instead.
> Made copy but didn't solve the problem.
>
> Map parameterMap - request.getParameterMap();
> session.setAttribute("PARMS", parameterMap);

Just for completeness, this isn't making a copy.

I've sort of lost track now; is this interceptor running for every request?

Dave


Attachment: user_182328.ezm (zipped)

Hi there,

I'm a newbie in Struts 2 and in Java EE programming... I tried to search
about this but i didn't found any succesfull answer. So I'm trying to ask to
this ML :)

I need to make a form that permits an user to upload a file. I had the
"so-well-known" MultiWrapper problem, and I managed it by adding the
commons-fileupload jar. But... it didn't work!!!

I got a <s:form action="uploadData" ...> and a <s:file name="upload"
label="File"\>. In my struts.xml file, I've got a package who extends
struts-jsf-default (we're planning to use JSF) and defined the uploadData
action who calls a InsertDataAction class, and in particular a specific
method of that class (let's call it insert() ). Of course, this class has
got the needed private attributes (File file, String filename, String
contentType) and the appropriate getters/setters (afaik, they need to have
the name set[filename][attribute], like setUploadFile in my case and so on).
I got no exception at runtime, but I can't get that file to be uploaded. In
my insert() I try to s.o.p. the attributes, I got everything null. I also
watched my server.log (I'm using JBoss as AS), and nothing useful is written
out.

I wondered if using the struts-jsf-default may corrupt the file upload
interceptor, but I'm really not able to answer myself this question.

Any help will be kindly appreciated :)

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


Attachment: user_182329.ezm (zipped)

Is it possible to assign a collection to a html:hidden component, rather than
a string?
Basically my webapp allows the user to select different options for access
control. I would like to add these selections to a collection and pass that
to my Action class.

Thanks inadvance!!

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


Attachment: user_182330.ezm (zipped)
do you have getters/setters(I am guessing the setters are missing) in
your action for all the form fields?

musachy

On Feb 6, 2008 10:29 AM, Nushi <danny.bollaert@(protected):
>
> I only seem to get my values of my form when i repost.
>
> CODE
>
> <%@(protected)" %>
> <html>
> <head>
> <title>File Upload Example</title>
> <link href="<s:url value="/css/main.css"/>" rel="stylesheet"
> type="text/css"/>
>
> </head>
>
> <body>
>
> <s:actionerror />
> <s:fielderror />
> <s:form action="doUpload" method="POST" enctype="multipart/form-data">
> <tr>
> <td colspan="2"><h1>File Upload Example</h1></td>
> </tr>
>
> <s:textfield name="title" label="Title" id="title"/>
> <s:submit />
> </s:form>
> </body>
> </html>
>
>
> <s:property value="title" /></td>
>
>
>      <package name="example" extends="struts-default">
>
>
>
>
>           <action name="showUpload" method="input">
>                 <result>pages/upload.jsp</result>
>
>           </action>
>
>           <action name="doUpload"
>                 class="Upload" >
>                 <result name="input">showUpload</result>
> <result>pages/upload-success.jsp</result>
>           </action>
>      </package>
>
>
> I get nothing, until I refresh my page, and then it fills my values.
>
> Thx in advance!
>
> Nushi
> --
> View this message in context: http://www.nabble.com/STRUTS-2%3A-fail-to-retrieve-values-without-repost-tp15306729p15306729.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)
>
>



--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment: user_182337.ezm (zipped)

I forgot to map my success.

That's why it only send information on my repost.

Thanks

Musachy Barroso wrote:
>
> do you have getters/setters(I am guessing the setters are missing) in
> your action for all the form fields?
>
> musachy
>
> On Feb 6, 2008 10:29 AM, Nushi <danny.bollaert@(protected):
>>
>> I only seem to get my values of my form when i repost.
>>
>> CODE
>>
>> <%@(protected)" %>
>> <html>
>> <head>
>> <title>File Upload Example</title>
>> <link href="<s:url value="/css/main.css"/>" rel="stylesheet"
>> type="text/css"/>
>>
>> </head>
>>
>> <body>
>>
>> <s:actionerror />
>> <s:fielderror />
>> <s:form action="doUpload" method="POST" enctype="multipart/form-data">
>> <tr>
>> <td colspan="2"><h1>File Upload Example</h1></td>
>> </tr>
>>
>> <s:textfield name="title" label="Title" id="title"/>
>> <s:submit />
>> </s:form>
>> </body>
>> </html>
>>
>>
>> <s:property value="title" /></td>
>>
>>
>>      <package name="example" extends="struts-default">
>>
>>
>>
>>
>>           <action name="showUpload" method="input">
>>                 <result>pages/upload.jsp</result>
>>
>>           </action>
>>
>>           <action name="doUpload"
>>                 class="Upload" >
>>                 <result name="input">showUpload</result>
>> <result>pages/upload-success.jsp</result>
>>           </action>
>>      </package>
>>
>>
>> I get nothing, until I refresh my page, and then it fills my values.
>>
>> Thx in advance!
>>
>> Nushi
>> --
>> View this message in context:
>> http://www.nabble.com/STRUTS-2%3A-fail-to-retrieve-values-without-repost-tp15306729p15306729.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)
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

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


Attachment: user_182331.ezm (zipped)
There's javascript involved as you're using an ajax submit.

When your form is posted the submit button shows loading text in your
target div. In IE, if the target div contains the form you're posting,
it overwrites the form in the DOM prior to posting and the XHR request
fails. It's a problem related to the incorrect/inconsistent ordering of
events in IE.

Add the showLoadingText="false" attribute to your ajax submit button(s)
and it'll be okay.

regards,
Jeromy evans

Marc Eckart wrote:
> Hi,
>
> I have a <s:select> tag which behaves different in IE 6.0 and firefox. In
> Firefox the underlying property in my struts action is filled in IE not.
>
> This is my code?
>
> <s:form id="searchAdvisorIdsForm" action="searchAdvisorIds" method="post" >
>
> .....
>
> <s:select name="branchSearch"
>       headerKey=""
>       headerValue="-- Bitte wählen --"
>       list="branchNameList"
>       cssClass="medium"
>     />
>
> ....
>
>   <s:submit theme="ajax" targets="organizersearch" key="button.search"
> value="Suchen" cssClass="pushbutton" />
>
> ....
>
> </s:form>
>
> I have no idea why it works in Firefox and not in IE. Because there is no
> JavaScript involved (or am I wrong).
>
> Best regards.
>
> Marc
>
>  
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.19.21/1263 - Release Date: 6/02/2008 8:14 PM
>  


Attachment: user_182332.ezm (zipped)
yep..the showLoadingText param is passed to the ajax-common.ftl
specifically..
<#if parameters.showLoadingText?exists>
  showLoading="${parameters.showLoadingText?string?html}"<#rt/>
</#if>

.also be sure to null out loadingText..

M--
----- Original Message -----
From: "Jeromy Evans" <jeromy.evans@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Wednesday, February 06, 2008 6:41 PM
Subject: Re: Problem s:select in IE and Firefox


> There's javascript involved as you're using an ajax submit.
>
> When your form is posted the submit button shows loading text in your
> target div. In IE, if the target div contains the form you're posting,
> it overwrites the form in the DOM prior to posting and the XHR request
> fails. It's a problem related to the incorrect/inconsistent ordering of
> events in IE.
>
> Add the showLoadingText="false" attribute to your ajax submit button(s)
> and it'll be okay.
>
> regards,
> Jeromy evans
>
> Marc Eckart wrote:
> > Hi,
> >
> > I have a <s:select> tag which behaves different in IE 6.0 and firefox.
In
> > Firefox the underlying property in my struts action is filled in IE not.
> >
> > This is my code?
> >
> > <s:form id="searchAdvisorIdsForm" action="searchAdvisorIds"
method="post" >
> >
> > .....
> >
> > <s:select name="branchSearch"
> >       headerKey=""
> >       headerValue="-- Bitte wählen --"
> >       list="branchNameList"
> >       cssClass="medium"
> >     />
> >
> > ....
> >
> >   <s:submit theme="ajax" targets="organizersearch" key="button.search"
> > value="Suchen" cssClass="pushbutton" />
> >
> > ....
> >
> > </s:form>
> >
> > I have no idea why it works in Firefox and not in IE. Because there is
no
> > JavaScript involved (or am I wrong).
> >
> > Best regards.
> >
> > Marc
> >
> >
> > ------------------------------------------------------------------------
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.516 / Virus Database: 269.19.21/1263 - Release Date:
6/02/2008 8:14 PM
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_182333.ezm (zipped)

Hello,

I am using file tag works fine if a file is selected using browse button or the path is entered manually. But if file name/path is rubbish the form is not submitted at all, nothing happens.

1. How do I control this - show error like invalid filename?
2. Or else how to disable manual entry, only browse button works???????
3. I tried javascript options like onKeypress to reset value to null - didnt help.

Please help.
Regards,

Srikanth 




< s:form action = "/createEnt2.do" method = "POST" enctype = "multipart/form-data" validate = "true" > s:form action = "/createEnt2.do" method = "POST" enctype = "multipart/form-data" validate = "true" >

         < s:file name = "dc" id = "dc" accept = "text/*" label = "Digital Certificate" onkeydown = "return reset1();" />          < s:file name = "dc" id = "dc" accept = "text/*" label = "Digital Certificate" onkeydown = "return reset1();" />



</ </ s:form >

</ </ s:form >

function reset1() reset1()

{

var thisForm = document.forms[0];

thisForm.dc.value = 'all' ;



window.alert( "sfds" ); thisForm = document.forms[0];

thisForm.dc.value = 'all' ;



window.alert( "sfds" ); 'all' ;



window.alert( "sfds" ); "sfds" );

}

Java ###########################

private File dc ;

private String uploadContentType ; //The content type of the file private File dc ;

private String uploadContentType ; //The content type of the file private String uploadContentType ; //The content type of the file

private String uploadFileName ; //The uploaded file name

/** private String uploadFileName ; //The uploaded file name

/** /**

* @return the dc * @return the dc

*/ */

public File getDc() {

return dc ;

}



/** public File getDc() {

return dc ;

}



/** return dc ;

}



/** /**

* @param dc the dc to set * @param dc the dc to set

*/ */

public void setDc(File dc) {

this . dc = dc;

}



/** public void setDc(File dc) {

this . dc = dc;

}



/** this . dc = dc;

}



/** /**

* @return the uploadContentType * @return the uploadContentType

*/ */

public String getUploadContentType() {

return uploadContentType ;

}



/** public String getUploadContentType() {

return uploadContentType ;

}



/** return uploadContentType ;

}



/** /**

* @param uploadContentType the uploadContentType to set * @param uploadContentType the uploadContentType to set

*/ */

public void setUploadContentType(String uploadContentType) {

this . uploadContentType = uploadContentType;

}



/** public void setUploadContentType(String uploadContentType) {

this . uploadContentType = uploadContentType;

}



/** this . uploadContentType = uploadContentType;

}



/** /**

* @return the uploadFileName * @return the uploadFileName

*/ */

public String getUploadFileName() {

return uploadFileName ;

}



/** public String getUploadFileName() {

return uploadFileName ;

}



/** return uploadFileName ;

}



/** /**

* @param uploadFileName the uploadFileName to set * @param uploadFileName the uploadFileName to set

*/ */

public void setUploadFileName(String uploadFileName) {

this . uploadFileName = uploadFileName;

} public void setUploadFileName(String uploadFileName) {

this . uploadFileName = uploadFileName;

} this . uploadFileName = uploadFileName;

}


Attachment: user_182334.ezm (zipped)
Hi Sri

so if the config is configured something like
/WEB-INF/classes/struts-fileupload.xml
  <action name="doUpload"
class="org.apache.struts2.showcase.fileupload.FileUploadAction"
method="upload">
    <result name="success">uploadSuccess.jsp</result>
    <result name="error">uploadError.jsp</result>
</action>

and the jsp defines the acceptable content-type and a name to call it..
<s:file name="upload" accept="text/*" />

org.apache.struts2.portlet.example.fileupload.FileUploadAction.java
{
 private String fileName;   //this is the FULL pathname with filename

  // since we are using <s:file name="upload" .../> the file name will be
obtained through getter/setter of <file-tag-name>FileName
  public String getUploadFileName()
  {
    return fileName;
  }
  public void setUploadFileName(String fileName)
 {
    this.fileName = fileName;
  }

 // since we are using <s:file name="upload" ... /> the File itself will
be obtained through getter/setter of <file-tag-name>
  public File getUpload()
  {
    java.io.File file;
    try
    { //try to create the file with the previously provided filename
      file= new java.io.File( filename );
    }
    catch(java.lang.NullPointerException excp)
    {
       return ERROR;
     }
     if(file.canRead()) return SUCCESS;
     else return ERROR;
  }

  public void setUpload(File upload)
  {
   this.upload = upload;
  }
}

I didnt test with the templateDir attribute..

HTH/
M-
----- Original Message -----
Wrom: FPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZC
To: "Struts Users Mailing List" <user@(protected)>
Sent: Wednesday, February 06, 2008 8:50 PM
Subject: STRUTS 2: File tag problem



Hello,

I am using file tag works fine if a file is selected using browse button or
the path is entered manually. But if file name/path is rubbish the form is
not submitted at all, nothing happens.

1. How do I control this - show error like invalid filename?
2. Or else how to disable manual entry, only browse button works???????
3. I tried javascript options like onKeypress to reset value to null - didnt
help.

Please help.
Regards,

Srikanth




< s:form action = "/createEnt2.do" method = "POST" enctype =
"multipart/form-data" validate = "true" > s:form action = "/createEnt2.do"
method = "POST" enctype = "multipart/form-data" validate = "true" >

< s:file name = "dc" id = "dc" accept = "text/*" label = "Digital
Certificate" onkeydown = "return reset1();" /> < s:file name = "dc" id =
"dc" accept = "text/*" label = "Digital Certificate" onkeydown = "return
reset1();" />



</ </ s:form >

</ </ s:form >

function reset1() reset1()

{

var thisForm = document.forms[0];

thisForm.dc.value = 'all' ;



window.alert( "sfds" ); thisForm = document.forms[0];

thisForm.dc.value = 'all' ;



window.alert( "sfds" ); 'all' ;



window.alert( "sfds" ); "sfds" );

}

Java ###########################

private File dc ;

private String uploadContentType ; //The content type of the file private
File dc ;

private String uploadContentType ; //The content type of the file private
String uploadContentType ; //The content type of the file

private String uploadFileName ; //The uploaded file name

/** private String uploadFileName ; //The uploaded file name

/** /**

* @return the dc * @return the dc

*/ */

public File getDc() {

return dc ;

}



/** public File getDc() {

return dc ;

}



/** return dc ;

}



/** /**

* @param dc the dc to set * @param dc the dc to set

*/ */

public void setDc(File dc) {

this . dc = dc;

}



/** public void setDc(File dc) {

this . dc = dc;

}



/** this . dc = dc;

}



/** /**

* @return the uploadContentType * @return the uploadContentType

*/ */

public String getUploadContentType() {

return uploadContentType ;

}



/** public String getUploadContentType() {

return uploadContentType ;

}



/** return uploadContentType ;

}



/** /**

* @param uploadContentType the uploadContentType to set * @param
uploadContentType the uploadContentType to set

*/ */

public void setUploadContentType(String uploadContentType) {

this . uploadContentType = uploadContentType;

}



/** public void setUploadContentType(String uploadContentType) {

this . uploadContentType = uploadContentType;

}



/** this . uploadContentType = uploadContentType;

}



/** /**

* @return the uploadFileName * @return the uploadFileName

*/ */

public String getUploadFileName() {

return uploadFileName ;

}



/** public String getUploadFileName() {

return uploadFileName ;

}



/** return uploadFileName ;

}



/** /**

* @param uploadFileName the uploadFileName to set * @param uploadFileName
the uploadFileName to set

*/ */

public void setUploadFileName(String uploadFileName) {

this . uploadFileName = uploadFileName;

} public void setUploadFileName(String uploadFileName) {

this . uploadFileName = uploadFileName;

} this . uploadFileName = uploadFileName;

}



Attachment: user_182348.ezm (zipped)
Hi Martin,

Thanks for the reply. I didnt quite get what you are trying to say. My code is exactly similar to the example you given except the implementation for method "public File getUpload()". In your example it return SUCCESS and ERROR which are strings but it should return File. I have only one line "return dc". Please help if I am missing something here.

I tried to give some logic to getFileName() and getDc() (=getUpload()) methods but the issue is still there, if crap is typed into file field - nothing happens when submit is clicked.

Regards,

Srikanth





-----Original Message-----
From: mgainty@(protected)]
Sent: Thursday, 7 February 2008 1:50 PM
To: Struts Users Mailing List
Subject: Re: STRUTS 2: File tag problem

Hi Sri

so if the config is configured something like
/WEB-INF/classes/struts-fileupload.xml
  <action name="doUpload"
class="org.apache.struts2.showcase.fileupload.FileUploadAction"
method="upload">
    <result name="success">uploadSuccess.jsp</result>
    <result name="error">uploadError.jsp</result>
</action>

and the jsp defines the acceptable content-type and a name to call it..
<s:file name="upload" accept="text/*" />

org.apache.struts2.portlet.example.fileupload.FileUploadAction.java
{
 private String fileName;   //this is the FULL pathname with filename

  // since we are using <s:file name="upload" .../> the file name will be
obtained through getter/setter of <file-tag-name>FileName
  public String getUploadFileName()
  {
    return fileName;
  }
  public void setUploadFileName(String fileName)
 {
    this.fileName = fileName;
  }

 // since we are using <s:file name="upload" ... /> the File itself will
be obtained through getter/setter of <file-tag-name>
  public File getUpload()
  {
    java.io.File file;
    try
    { //try to create the file with the previously provided filename
      file= new java.io.File( filename );
    }
    catch(java.lang.NullPointerException excp)
    {
       return ERROR;
     }
     if(file.canRead()) return SUCCESS;
     else return ERROR;
  }

  public void setUpload(File upload)
  {
   this.upload = upload;
  }
}

I didnt test with the templateDir attribute..

HTH/
M-
----- Original Message -----
Wrom: FPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZC
To: "Struts Users Mailing List" <user@(protected)>
Sent: Wednesday, February 06, 2008 8:50 PM
Subject: STRUTS 2: File tag problem



Hello,

I am using file tag works fine if a file is selected using browse button or
the path is entered manually. But if file name/path is rubbish the form is
not submitted at all, nothing happens.

1. How do I control this - show error like invalid filename?
2. Or else how to disable manual entry, only browse button works???????
3. I tried javascript options like onKeypress to reset value to null - didnt
help.

Please help.
Regards,

Srikanth




< s:form action = "/createEnt2.do" method = "POST" enctype =
"multipart/form-data" validate = "true" > s:form action = "/createEnt2.do"
method = "POST" enctype = "multipart/form-data" validate = "true" >

< s:file name = "dc" id = "dc" accept = "text/*" label = "Digital
Certificate" onkeydown = "return reset1();" /> < s:file name = "dc" id =
"dc" accept = "text/*" label = "Digital Certificate" onkeydown = "return
reset1();" />



</ </ s:form >

</ </ s:form >

function reset1() reset1()

{

var thisForm = document.forms[0];

thisForm.dc.value = 'all' ;



window.alert( "sfds" ); thisForm = document.forms[0];

thisForm.dc.value = 'all' ;



window.alert( "sfds" ); 'all' ;



window.alert( "sfds" ); "sfds" );

}

Java ###########################

private File dc ;

private String uploadContentType ; //The content type of the file private
File dc ;

private String uploadContentType ; //The content type of the file private
String uploadContentType ; //The content type of the file

private String uploadFileName ; //The uploaded file name

/** private String uploadFileName ; //The uploaded file name

/** /**

* @return the dc * @return the dc

*/ */

public File getDc() {

return dc ;

}



/** public File getDc() {

return dc ;

}



/** return dc ;

}



/** /**

* @param dc the dc to set * @param dc the dc to set

*/ */

public void setDc(File dc) {

this . dc = dc;

}



/** public void setDc(File dc) {

this . dc = dc;

}



/** this . dc = dc;

}



/** /**

* @return the uploadContentType * @return the uploadContentType

*/ */

public String getUploadContentType() {

return uploadContentType ;

}



/** public String getUploadContentType() {

return uploadContentType ;

}



/** return uploadContentType ;

}



/** /**

* @param uploadContentType the uploadContentType to set * @param
uploadContentType the uploadContentType to set

*/ */

public void setUploadContentType(String uploadContentType) {

this . uploadContentType = uploadContentType;

}



/** public void setUploadContentType(String uploadContentType) {

this . uploadContentType = uploadContentType;

}



/** this . uploadContentType = uploadContentType;

}



/** /**

* @return the uploadFileName * @return the uploadFileName

*/ */

public String getUploadFileName() {

return uploadFileName ;

}



/** public String getUploadFileName() {

return uploadFileName ;

}



/** return uploadFileName ;

}



/** /**

* @param uploadFileName the uploadFileName to set * @param uploadFileName
the uploadFileName to set

*/ */

public void setUploadFileName(String uploadFileName) {

this . uploadFileName = uploadFileName;

} public void setUploadFileName(String uploadFileName) {

this . uploadFileName = uploadFileName;

} this . uploadFileName = uploadFileName;

}



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



Attachment: user_182335.ezm (zipped)
Create a file With name UserAction-validation.xml

and copy the below content

go through the struts2 validation frame work

<validators>

<field name="usr.userId">

<field-validator type="requiredstring">

<message>School name required</message>

</field-validator>

</field>

</validators>


On 2/6/08, slideharmony <setoiori@(protected):
>
>
> Hello!
> I have to validate a composed object in my action, this is my action:
>
>
> public class UserAction extends ActionSupport{
>
> private User usr;
>
> public User getUser() {return usr;}
> public void setUser(User usr) {this.usr = usr;}
>
> }
>
>
>
>
> and this is User class:
>
> public class User{
>
>  private String usrId;
>
>  public String getUsrId(){
>     return usrId;
> }
>
>  public void setUsrId(String usrId){
>     this.usrId = usrId;
>  }
>
>
> }
>
>
> How can I validate usrId property with annotations or xml
> without putting annotations inside User class?
>
> Any help would be appreciate!
>
> Thanks in advance,
> Riccardo
> --
> View this message in context:
> http://www.nabble.com/How-can-I-validate-a-composed-object-in-my-action-%28Struts-2%29-tp15306468p15306468.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_182336.ezm (zipped)
I have an application that needs to show messages coming from SAP in polish
language.



What would be the changes in need to do for my web.xml,struts config.xml and
jsp pages..

Certain polish fonts were corrupted and shown question marks..

Please advice


Attachment: user_182342.ezm (zipped)
hi,

where do you have these messages? is it in the .properties file? if its
in a property file i think it should be in UTF-8 and your jsp page
charset also should be in UTF8

Thanks,

Nuwan
(http://code.google.com/p/struts2-ssl-plugin/)




Raghuveer wrote:
> I have an application that needs to show messages coming from SAP in polish
> language.
>
>
>
> What would be the changes in need to do for my web.xml,struts config.xml and
> jsp pages..
>
> Certain polish fonts were corrupted and shown question marks..
>
> Please advice
>
>
>  


Attachment: user_182347.ezm (zipped)

What You need to do, is to set correct page coding. It can be ISO-8859-2 or
UTF-8

Best regards

Piotr Falenczyk


raghuveerv wrote:
>
> I have an application that needs to show messages coming from SAP in
> polish
> language.
>
>
>
> What would be the changes in need to do for my web.xml,struts config.xml
> and
> jsp pages..
>
> Certain polish fonts were corrupted and shown question marks..
>
> Please advice
>
>
>


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


Attachment: user_182338.ezm (zipped)

Hi,
  I am having struts2 application with hibernate + mysql.I want to create
web app session Expired page,but i am not able to detect weather my
application session expired or not.

I have given session time out to 1 min also but it still displays active
session.
<session-config>
 <session-timeout>1</session-timeout>
</session-config>

My SessionChecking interceptor looks like:-

public class SessionExpired implements Interceptor {
  public void destroy() {
 LOG.info("..............destroy");
  }

  public void init() {
 LOG.info("..............init");
 }
 
  public String intercept(ActionInvocation actionInvocation) throws
Exception {
 Map session = actionInvocation.getInvocationContext().getSession();
 if(session == null) {
    LOG.info("..............interce if");
 }
 else {
    LOG.info("..............interce else");
 }
 return actionInvocation.invoke();
  }
}

After 1..2...3...5 min it still logging ("..............interce else").

Do anyone know how can i detect my application session time out or not ?

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


Attachment: user_182341.ezm (zipped)
Hi,

Why dont you check for a particular attribute you have added to the
session in your interceptor.

eg:- when a user login you add the attribute logedin to true.
    session.setAttribute("logedin","true");

    and in the incerceptor you check if its there or null, if its not
there or null that means the session has expired.

Thanks,

Nuwan
(http://code.google.com/p/struts2-ssl-plugin/)







jignesh.patel wrote:
> Hi,
>   I am having struts2 application with hibernate + mysql.I want to create
> web app session Expired page,but i am not able to detect weather my
> application session expired or not.
>
> I have given session time out to 1 min also but it still displays active
> session.
> <session-config>
>  <session-timeout>1</session-timeout>
> </session-config>
>
> My SessionChecking interceptor looks like:-
>
> public class SessionExpired implements Interceptor {
>   public void destroy() {
>  LOG.info("..............destroy");
>   }
>
>   public void init() {
>  LOG.info("..............init");
>  }
>  
>   public String intercept(ActionInvocation actionInvocation) throws
> Exception {
>  Map session = actionInvocation.getInvocationContext().getSession();
>  if(session == null) {
>     LOG.info("..............interce if");
>  }
>  else {
>     LOG.info("..............interce else");
>  }
>  return actionInvocation.invoke();
>   }
> }
>
> After 1..2...3...5 min it still logging ("..............interce else").
>
> Do anyone know how can i detect my application session time out or not ?
>
> Thanks & regards
> jignesh
>  


Attachment: user_182345.ezm (zipped)
Hi,

I recommend to you should see *SessionInactivityFilter *on* *
http://javawebparts.sourceforge.net/ page for page rejection and forwarding
for session inactivity. However you must see to
*HttpSessionListener *for created and destroyed sessions.

Sample SessionCaptor:

/*
*
*/
public class SessionCaptor implements HttpSessionListener {

  private static int activeSessions = 0;

  public SessionCaptor() {
  }

  public void sessionCreated(HttpSessionEvent se){
    HttpSession session = se.getSession( );

    session.setMaxInactiveInterval(30 * 60);

    activeSessions++;

    System.out.println("Session: " + (new Date( )).toString() + " ID:" +
session.getId( ) + " - Active sessions: " + activeSessions);
  }

  public void sessionDestroyed(HttpSessionEvent se){
    HttpSession session = se.getSession( );

    if(activeSessions > 0)
       activeSessions--;

    System.out.println("Session Closed: " + (new Date( )).toString() + "
ID:" + session.getId() + " - Active sessions: " + activeSessions);

    session.invalidate();
  }

  public static int getActiveSessions() {
    return activeSessions;
  }
}

in *web.xml

* <listener>
  <listener-class>
   package.SessionCaptor
  </listener-class>
</listener>
*
*Regards.
Okan.
*
*On Feb 7, 2008 8:50 AM, jignesh.patel <jigneshd@(protected):

>
> Hi,
>   I am having struts2 application with hibernate + mysql.I want to create
> web app session Expired page,but i am not able to detect weather my
> application session expired or not.
>
> I have given session time out to 1 min also but it still displays active
> session.
> <session-config>
>     <session-timeout>1</session-timeout>
> </session-config>
>
> My SessionChecking interceptor looks like:-
>
> public class SessionExpired implements Interceptor {
>   public void destroy() {
>     LOG.info("..............destroy");
>   }
>
>   public void init() {
>     LOG.info("..............init");
>     }
>
>   public String intercept(ActionInvocation actionInvocation) throws
> Exception {
>     Map session = actionInvocation.getInvocationContext().getSession();
>     if(session == null) {
>         LOG.info("..............interce if");
>     }
>     else {
>        LOG.info("..............interce else");
>     }
>     return actionInvocation.invoke();
>   }
> }
>
> After 1..2...3...5 min it still logging ("..............interce else").
>
> Do anyone know how can i detect my application session time out or not ?
>
> Thanks & regards
> jignesh
> --
> View this message in context:
> http://www.nabble.com/Struts2-sesionExpired-page-tp15328299p15328299.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_182339.ezm (zipped)
Hi Richard,

I am also trying to integrate FCKEditor in Struts2.
Did you make any plugin for it?

I was going through Struts2 Mailing Lists and found that some people were
making a plugin for the same a few months back.

-Shantur

On Jan 29, 2008 2:10 PM, Julien RICHARD <richard.julien@(protected):

> I use Struts 2.0.11 and i have an dojo error when i wants to used
> textearea
> with Ajax theme (this create an richtext box).*
> After little research, this is an bug in dojo resolved in 2007/11.
> Dojo works perfectly for other features in my code, so i need to update
> the
> dojo in the struts core.
> Currently i have integrated FCKEditor instead.
>
> Regards,
>
> On Jan 29, 2008 6:37 AM, ravi_eze <ravichandrac@(protected):
>
> >
> > which version are u using??
> >
> > i think u are getting error like dojo not defined. If yes then read the
> > following
> >
> > u need to make dojo available do the following steps:
> >
> > 1. explode struts core.jar
> > 2. create a folder in the war : struts
> > 3. search for ajax,dojo,niftycorners,simple,xhtml in the exploded jars
> > (step
> > 1)
> > 4. copy them all into the struts folder (step 2)
> >
> > start teh tomcat.
> >
> > view sourcet the page u are tring to use.. u will see the js files its
> > tryuing to fetch from the server.. the above steps make sure that they
> all
> > exist on the server..
> >
> > hope this helps.
> >
> > ravi
> >
> >
> > Julien RICHARD-2 wrote:
> > >
> > > Hi,
> > >
> > > I'm new in the mailing list, so hi to all users.
> > > Little presentation : french java struts2 developer.
> > >
> > > I have a question. I want to use richtext box with dojo (textarea
> > > theme="ajax") but i cant. In fact, the embedded version of dojo have a
> > > error
> > > and i need to update the dojo version. How can i make this with
> "simple"
> > > operation ?
> > >
> > > Thanks for your answers.
> > >
> > >
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/-STRUTS2--Error-in-Dojo---Howto-update-Dojo-tp15132308p15152849.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)
> >
> >
>
>
> --
> RICHARD Julien,
> UNILOG
>

Attachment: user_182340.ezm (zipped)
Hi All,

I am trying to get FCKEditor work with Struts2. I have read that some poeple
on list were making a Struts2 plugin for the same.
Does the plugin exist?

Thanks,
Shantur

Attachment: user_182343.ezm (zipped)

Please give me advices what would be the best approach in the struts 2 world
to realize a limited view (authorization).

In struts 1 I would have created a simple tag which is able to render it
childs dependent on
authorization of user, something like:
<mytags:guard permission="write">
... some content ...
</mytags:guard>

Is there a better / more elegant / more flexible alternative in struts2?

Thank you very much in advance
Basti
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_182344.ezm (zipped)


Hi there !


I have just visited this page :
http://www.easyuktest.co.uk/Yagoogle.html

Is it OK to use a company name this way ?

*********************************************************************************
Working Together for a Better Tower Hamlets
Web site : http://www.towerhamlets.gov.uk

London Borough of Tower Hamlets E-Mail Disclaimer.

This communication and any attachments are intended for the addressee only and may be confidential. It may contain privileged and confidential information and if you are not the intended recipient, you must not copy, distribute or take any action in reliance on it. If you have received this E-Mail in error please notify us as soon as possible and delete this E-Mail and any attachments. This message has been checked for viruses, however we cannot guarantee that this message or any attachment is virus free or has not been intercepted or amended. The information contained in this E-Mail may be subject to public disclosure under the Freedom of Information Act 2000. Unless the information is legally exempt from disclosure, the Confidentiality of this E-Mail and your reply cannot be guaranteed.

If your request relates to a Freedom of Information enquiry, please resend this to foi@(protected)
************************************************************************************


Attachment: user_182349.ezm (zipped)
I miss the killer scam letter :-)

Antonio

2008/2/7, Jose Cardoso <Jose.Cardoso@(protected)>:
>
>
>
> Hi there !
>
>
> I have just visited this page :
> http://www.easyuktest.co.uk/Yagoogle.html
>
> Is it OK to use a company name this way ?
>
>
> *********************************************************************************
> Working Together for a Better Tower Hamlets
> Web site : http://www.towerhamlets.gov.uk
>
> London Borough of Tower Hamlets E-Mail Disclaimer.
>
> This communication and any attachments are intended for the addressee
> only and may be confidential. It may contain privileged and confidential
> information and if you are not the intended recipient, you must not copy,
> distribute or take any action in reliance on it. If you have received this
> E-Mail in error please notify us as soon as possible and delete this E-Mail
> and any attachments. This message has been checked for viruses, however we
> cannot guarantee that this message or any attachment is virus free or has
> not been intercepted or amended. The information contained in this E-Mail
> may be subject to public disclosure under the Freedom of Information Act
> 2000. Unless the information is legally exempt from disclosure, the
> Confidentiality of this E-Mail and your reply cannot be guaranteed.
>
> If your request relates to a Freedom of Information enquiry, please resend
> this to foi@(protected)
>
> ************************************************************************************
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_182346.ezm (zipped)

Hello

I have a following problem

I have an action defined, let's say:

public class SomeAction extends ActionSupport implements SessionAware{

private Map sessionMap;

    @Override
 public String execute() throws Exception {

   return SUCCESS;
 }

    public void setSession(Map map) {
   this.sessionMap = map;
 }

 public long getSideId() {
   return sideId;
 }

 public List<Import> getImports() {
   return (List<Import>)sessionMap.get("imports");
 }
 
 public void setImports(List<Import> imports) {
   sessionMap.set("imports", imports);
 }

}

The Import class is a simple POJO

public class Import extends Serialicable {

private String name;

    public String getName() {
   return name;
 }
 
 public void setName(String name) {
   this.name = name;
 }

}


I need to display all the names of Imports, and allow to edit every one of
them in one page. What I do now is somethin like that ion JSP. Displaying
values work just fine, but I canno't change them (not stored back in the
session)


<s:iterator value="imports">

<s:textfield name="name" /> </br>

<s:iterator/>


What I know is that I need to set for name of every textfield
"imports[index_in_list].name" in order to make it work, but how can I do it?

Thanks for help in advance

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

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