How to convert output of into int?

2008-12-22 Thread taj uddin
Hi,

 In my application i should pass the output of  tag into a 
method which accepts only int-type parameter.
So, is there any scope to convert the output of  tag(which is 
usually a String) into the int value.
For ex:-In my application I'm passing the output of tag into a 
javascript's addItem() method of menus where my addItem() method is defined to 
accept int as parameter.
So, pls help me out in this regard.





  

How to convert output of into int?

2008-12-22 Thread taj uddin
Hi,

 In my application i should pass the output of  tag into a 
method which accepts only int-type parameter.
So, is there any scope to convert the output of  tag(which is 
usually a String) into the int value.
For ex:-In my application I'm passing the output of tag into a 
javascript's addItem() method of menus where my addItem() method is defined to 
accept int as parameter.
So, pls help me out in this regard.





  

Re: Step by Step Struts 2 tutorial

2008-12-22 Thread Steven Yang
Great Thanks a lot
My company is just gonna start to use S2.
I can sure use your demos to teach my colleges

good job


Re: How to convert output of into int?

2008-12-22 Thread Steven Yang
>
> just print the property on your jsp or page actually

for example

var i = ;

will become
var i = 9;

then your javascript will interpret it as an int


Pls convert this code using struts2 tags

2008-12-22 Thread taj uddin
Hi

I am working on application where i have to convert the code developed in 
struts1.2 to struts2.0.
Here is the struts1.2 code:
 //Sub Menu for 2nd Main Menu Item ("ABC"):
    menus[1] = new 
menu(180, "vertical", 0, 0, -1, -1, "", "#ce122d", "Verdana,Helvetica", 8,
    "normal", 
"normal", "white", "#fcccb5", 1, "#ce122d", 2, 62, false, true, false, false, 
0, true, 4, 4, "black");
    <% int Index = 0; %>
    
    <% Index = 
idx.intValue() + 3; %>
    
menus[1].addItem("#", "", 20, "left", "", <%=Index%>);
    
    <% Index++; %>
    
menus[1].addItem("#", "", 20, "left", "PQR", <%=Index%>);
    <% Index++; %>
    
menus[1].addItem("#", "", 20, "left", "DEF", <%=Index%>);
    <% Index++; %>
    
menus[1].addItem("#", "", 20, "left", "XYZ", <%=Index%>);

Here is my struts2.0 code(below) :-

//Sub Menu for 2nd Main Menu Item ("ABC"):
    menus[1] = new 
menu(180, 

"vertical", 0, 0, -1, -1, "", "#ce122d", "Verdana,Helvetica", 8,
    "normal", 
"normal", 

"white", "#fcccb5", 1, "#ce122d", 2, 62, false, true, false, false, 0, true, 4, 
4, 

"black");
    <% int Index = 0; %>
    
    <% Index = 
idx.index() + 3; 

%>
    
menus[1].addItem("#", "", 

20, "left", "", <%=Index%>);
    
    <% Index++; %>
    
menus[1].addItem("#", "", 20, 

"left", "PQR", <%=Index%>);
    <% Index++; %>
    
menus[1].addItem("#", "", 20, 

"left", "DEF", <%=Index%>);
    <% Index++; %>
    
menus[1].addItem("#", "", 20, 

"left", "XYZ", <%=Index%>);

where i am getting the error on the line:
<% Index = idx.index() + 3; %>
indicating that idx cannot be resolved.

Pls help me out in this issue.








  

Re: Pls convert this code using struts2 tags

2008-12-22 Thread Nils-Helge Garli Hegvik
Take a look at the s:set and s:property tags.

Nils-H

On Mon, Dec 22, 2008 at 10:56 AM, taj uddin  wrote:
> Hi
>
> I am working on application where i have to convert the code developed in 
> struts1.2 to struts2.0.
> Here is the struts1.2 code:
>  //Sub Menu for 2nd Main Menu Item ("ABC"):
> menus[1] = new 
> menu(180, "vertical", 0, 0, -1, -1, "", "#ce122d", "Verdana,Helvetica", 8,
> "normal", 
> "normal", "white", "#fcccb5", 1, "#ce122d", 2, 62, false, true, false, false, 
> 0, true, 4, 4, "black");
> <% int Index = 0; 
> %>
>  indexId="idx" id="Table" name="Tables" scope="session">
> <% Index = 
> idx.intValue() + 3; %>
> 
> menus[1].addItem("#", "", 20, "left", " property="tableName"/>", <%=Index%>);
> 
> <% Index++; %>
> 
> menus[1].addItem("#", "", 20, "left", "PQR", <%=Index%>);
> <% Index++; %>
> 
> menus[1].addItem("#", "", 20, "left", "DEF", <%=Index%>);
> <% Index++; %>
> 
> menus[1].addItem("#", "", 20, "left", "XYZ", <%=Index%>);
>
> Here is my struts2.0 code(below) :-
>
> //Sub Menu for 2nd Main Menu Item ("ABC"):
> menus[1] = new 
> menu(180,
>
> "vertical", 0, 0, -1, -1, "", "#ce122d", "Verdana,Helvetica", 8,
> "normal", 
> "normal",
>
> "white", "#fcccb5", 1, "#ce122d", 2, 62, false, true, false, false, 0, true, 
> 4, 4,
>
> "black");
> <% int Index = 0; 
> %>
>  status="idx"
>
> id="Table" value="Tables" >
> <% Index = 
> idx.index() + 3;
>
> %>
> 
> menus[1].addItem("#", "",
>
> 20, "left", "", <%=Index%>);
> 
> <% Index++; %>
> 
> menus[1].addItem("#", "", 20,
>
> "left", "PQR", <%=Index%>);
> <% Index++; %>
> 
> menus[1].addItem("#", "", 20,
>
> "left", "DEF", <%=Index%>);
> <% Index++; %>
> 
> menus[1].addItem("#", "", 20,
>
> "left", "XYZ", <%=Index%>);
>
> where i am getting the error on the line:
> <% Index = idx.index() + 3; %>
> indicating that idx cannot be resolved.
>
> Pls help me out in this issue.
>
>
>
>
>
>
>
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] apply i18n on java entity from DB

2008-12-22 Thread Dimitar Vlasev
Hi Steven,
I don't know what's the best practice but I'll give you my quick thoughts.

It seems you have to implement some sort of logic (choosing the right name).
The main question is where is the best place to put this kind of logic?

IMO this kind of problems are solved using the "decorator pattern".
In the given example I'd choose to create "decorator" class for the
Product class

public class LocaleAwareProduct extends Product {
private Locale locale;
private String displayName;

private LocaleAwareProduct() {
 // hide the default constructor
}

private LocaleAwareProduct(Produt aProduct, Locale aLocale) {
this.locale = aLocale;
if ( "en".equalsIgnoreCase(aLocale.getLanguage()) ) {
 this.displayName = aProduct.englissh_name;
} else {
if ( "fr".equalsIgnoreCase(aLocale.getLanguage()) ) {
 this.displayName = aProduct.french_name;
}
{
}
}

Wrapping "products" into "locale aware products" will enable you to
fetch the display name of a product without implementing the logic
into the "view component".

NOTE: the Java code has been typed in text editor and have never been
compiled so it might be buggy.

Regards,
Dimitar Vlasev

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Pls convert this code using struts2 tags

2008-12-22 Thread Nils-Helge Garli Hegvik
That's hard to say considering I know nothing about what result you
expect, and what the rendered html actually looks like. But from your
code, it looks like the "Index1", "Index2" and "Index3" variables
might not have the value you expect them to be. And do you really need
to store the index in a variable?

Nils-H

On Mon, Dec 22, 2008 at 11:11 AM, taj uddin  wrote:
>
> Hey I have tried using  and  tags. By using them, i am
> not getting any error but my required Menu is not appearing on the header
> page.
> Here is the code:
>  //Sub Menu for 2nd Main Menu Item ("ABC"):
> menus[1] = new
> menu(180, "vertical", 0, 0, -1, -1, "", "#ce122d", "Verdana,Helvetica", 8,
> "normal",
> "normal", "white", "#fcccb5", 1, "#ce122d", 2, 62, false, true, false,
> false, 0, true, 4, 4, "black");
>
>  name="Index" value="0" />
>
>  value="%{#session.Tables}" status="idx" id="Table" >
>  name="Index" value="%{#idx.index}+3" />" />
>
>
> menus[1].addItem("#", "", 20, "left", ' />', '');
> 
>  name="Index1" value="%{#Index}+1" />
>
> menus[1].addItem("#", "", 20, "left", "PQR",' value="#Index1"/>');
>  name="Index2" value="%{#Index1}+1" />
>
> menus[1].addItem("#", "", 20, "left", "DEF", ' />');
>  name="Index3" value="%{#Index2}+1"/>
>
> menus[1].addItem("#", "", 20, "left", "XYZ", ' />');
>
> On the jsp page it is not displaying this menu.
> So, pls help me out
> --- On Mon, 12/22/08, Nils-Helge Garli Hegvik  wrote:
>
> From: Nils-Helge Garli Hegvik 
> Subject: Re: Pls convert this code using struts2 tags
> To: "Struts Users Mailing List" ,
> tajuddi...@yahoo.com
> Date: Monday, December 22, 2008, 5:04 AM
>
> Take a look at the s:set and s:property tags.
>
> Nils-H
>
> On Mon, Dec 22, 2008 at 10:56 AM, taj uddin  wrote:
>> Hi
>>
>> I am working on application where i have to convert the code developed in
> struts1.2 to struts2.0.
>> Here is the struts1.2 code:
>>  //Sub Menu for 2nd Main Menu Item ("ABC"):
>> menus[1] = new
> menu(180, "vertical", 0, 0, -1, -1, "", "#ce122d",
> "Verdana,Helvetica", 8,
>>
> "normal", "normal", "white", "#fcccb5",
> 1, "#ce122d", 2, 62, false, true, false, false, 0, true, 4, 4,
> "black");
>> <% int
> Index = 0; %>
>>
>   id="Table"
> name="Tables" scope="session">
>> <%
> Index = idx.intValue() + 3; %>
>>
> menus[1].addItem("#", "", 20, "left",
> " property="tableName"/>", <%=Index%>);
>>
> 
>> <% Index++;
> %>
>>
> menus[1].addItem("#", "", 20, "left",
> "PQR", <%=Index%>);
>> <% Index++;
> %>
>>
> menus[1].addItem("#", "", 20, "left",
> "DEF", <%=Index%>);
>>
>  <% Index++;
> %>
>>
> menus[1].addItem("#", "", 20, "left",
> "XYZ", <%=Index%>);
>>
>> Here is my struts2.0 code(below) :-
>>
>> //Sub Menu for 2nd Main Menu Item ("ABC"):
>> menus[1] = new
> menu(180,
>>
>> "vertical", 0, 0, -1, -1, "", "#ce122d",
> "Verdana,Helvetica", 8,
>>
> "normal", "normal",
>>
>> "white", "#fcccb5", 1, "#ce122d", 2, 62,
> false, true, false, false, 0, true, 4, 4,
>>
>> "black");
>> <% int
> Index = 0; %>
>>  status="idx"
>>
>> id="Table" value="Tables" >
>>
>  <%
> Index = idx.index() + 3;
>>
>> %>
>>
> menus[1].addItem("#", "",
>>
>> 20, "left", " value="#Table.tableName"/>", <%=Index%>);
>>
> 
>> <% Index++;
> %>
>>
> menus[1].addItem("#", "", 20,
>>
>> "left", "PQR", <%=Index%>);
>> <% Index++;
> %>
>>
> menus[1].addItem("#", "", 20,
>>
>> "left", "DEF", <%=Index%>);
>> <% Index++;
> %>
>>
>
> menus[1].addItem("#", "", 20,
>>
>> "left", "XYZ", <%=Index%>);
>>
>> where i am getting the error on the line:
>> <% Index = idx.index() + 3; %>
>> indicating that idx cannot be resolved.
>>
>> Pls help me out in this issue.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.o

[S2] Using tag for choosing file (no uploading)

2008-12-22 Thread Milan Milanovic

Hi,

I need to use  tag just to select file in the system, but not to
upload this file, I just want to get path to it, so that I can parse it in
my action class. However when I put this tag in the  tag and try to
select file, file was selected but I get an error in console about "missing
multipart/form-data for enctype"! How can I remove this error ?

One another question, I want to user that he can enter new filename in a
directory for exporting data, but I cannot use  for this because in
that case I need existing file. Which tag should I use ?

--
Thx, Milan
-- 
View this message in context: 
http://www.nabble.com/-S2--Using-%3Cs%3Afile-%3E-tag-for-choosing-file-%28no-uploading%29-tp21125988p21125988.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Pls convert this code using struts2 tags

2008-12-22 Thread Nils-Helge Garli Hegvik
I aparently cannot read, your indexes does look correct after all,
although maybe not needed... Sorry about that. I also didn't notice
until now that parts of the code is outside the s:iterator loop.
Seeing some of the generated html that doesn't work compared to what
does work could help.

Nils-H

On Mon, Dec 22, 2008 at 11:53 AM, taj uddin  wrote:
> Can u pls suggest me on how to use Index as a variable?
>
> Let me explain u in clear abt the application.
> From my stuts1.2 code u can understand that in  index value
> of iteration is stored in a variable "Index" and the value in that variable
> is incremented using JSP tags.
>
> But using struts2, the status attribute of  tag holds the index
> value of current iteration and i am trying to get that using index()
> method.So, how can i asign the value that the status attribut is holding to
> an ordinary where which can b used in JSP tags?
>
> --- On Mon, 12/22/08, Nils-Helge Garli Hegvik  wrote:
>
> From: Nils-Helge Garli Hegvik 
> Subject: Re: Pls convert this code using struts2 tags
> To: tajuddi...@yahoo.com, "Struts Users Mailing List"
> 
> Date: Monday, December 22, 2008, 5:23 AM
>
> That's hard to say considering I know nothing about what result you
> expect, and what the rendered html actually looks like. But from your
> code, it looks like the "Index1", "Index2" and
> "Index3" variables
> might not have the value you expect them to be. And do you really need
> to store the index in a variable?
>
> Nils-H
>
> On Mon, Dec 22, 2008 at 11:11 AM, taj uddin  wrote:
>>
>> Hey I have tried using  and  tags. By using
> them, i am
>> not getting any error but my required Menu is not appearing on the header
>> page.
>> Here is the code:
>>  //Sub Menu for 2nd Main Menu Item ("ABC"):
>> menus[1] = new
>>
>  menu(180, "vertical", 0, 0, -1, -1, "",
> "#ce122d", "Verdana,Helvetica", 8,
>>
> "normal",
>> "normal", "white", "#fcccb5", 1,
> "#ce122d", 2, 62, false, true, false,
>> false, 0, true, 4, 4, "black");
>>
>> > name="Index" value="0" />
>>
>> > value="%{#session.Tables}" status="idx"
> id="Table" >
>> > name="Index" value="%{#idx.index}+3" />" />
>>
>>
>> menus[1].addItem("#", "", 20, "left",
> '> />', '');
>>
> 
>>
> > name="Index1" value="%{#Index}+1" />
>>
>> menus[1].addItem("#", "", 20, "left",
> "PQR",'> value="#Index1"/>');
>> > name="Index2" value="%{#Index1}+1" />
>>
>> menus[1].addItem("#", "", 20, "left",
> "DEF", '> />');
>> > name="Index3" value="%{#Index2}+1"/>
>>
>> menus[1].addItem("#", "", 20, "left",
> "XYZ", '> />');
>>
>> On the jsp page it is not displaying this menu.
>> So, pls help me out
>> --- On Mon, 12/22/08, Nils-Helge Garli Hegvik 
> wrote:
>>
>> From: Nils-Helge Garli Hegvik 
>>
>  Subject: Re: Pls convert this code using struts2 tags
>> To: "Struts Users Mailing List" ,
>> tajuddi...@yahoo.com
>> Date: Monday, December 22, 2008, 5:04 AM
>>
>> Take a look at the s:set and s:property tags.
>>
>> Nils-H
>>
>> On Mon, Dec 22, 2008 at 10:56 AM, taj uddin 
> wrote:
>>> Hi
>>>
>>> I am working on application where i have to convert the code developed
> in
>> struts1.2 to struts2.0.
>>> Here is the struts1.2 code:
>>>  //Sub Menu for 2nd Main Menu Item ("ABC"):
>>> menus[1] =
> new
>> menu(180, "vertical", 0, 0, -1, -1, "",
> "#ce122d",
>> "Verdana,Helvetica", 8,
>>>
>> "normal", "normal", "white",
> "#fcccb5",
>> 1, "#ce122d", 2, 62, false, true, false, false, 0, true, 4, 4,
>>
>  "black");
>>> <% int
>> Index = 0; %>
>>>
>> >  id="Table"
>> name="Tables" scope="session">
>>> <%
>> Index = idx.intValue() + 3; %>
>>>
>> menus[1].addItem("#", "", 20, "left",
>> "> property="tableName"/>", <%=Index%>);
>>>
>> 
>>> <%
> Index++;
>> %>
>>>
>> menus[1].addItem("#", "", 20, "left",
>> "PQR", <%=Index%>);
>>> <%
> Index++;
>> %>
>>>
>> menus[1].addItem("#", "", 20, "left",
>> "DEF", <%=Index%>);
>>>
>>
>   <% Index++;
>> %>
>>>
>> menus[1].addItem("#", "", 20, "left",
>> "XYZ", <%=Index%>);
>>>
>>> Here is my struts2.0 code(below) :-
>>>
>>> //Sub Menu for 2nd Main Menu Item ("ABC"):
>>> menus[1] =
> new
>> menu(180,
>>>
>>> "vertical", 0, 0, -1, -1, "", "#ce122d",
>> "Verdana,Helvetica", 8,
>>>
>> "normal", "normal",
>>>
>>> "white", "#fcccb5", 1, "#ce122d", 2, 62,
>> fals

RE: Bean Properties are lost

2008-12-22 Thread Biesbrock, Kevin
 
Make sure you're putting everything in your jsp.  If the field doesn't
need to be displayed, use the  tag.

The problem is with your internal mail server.  Your company's spam
filter is viewing your email as spam; whether it be the destination or
content in your message, I don't know.  See if they can add the
destination to the whitelist (acceptable list).

Beez
( 4961 

-Original Message-
From: Richa Pandharikar [mailto:rich...@gmail.com] 
Sent: Friday, December 19, 2008 6:20 PM
To: user@struts.apache.org
Subject: Bean Properties are lost


I have a User Object that I am using as a Bean in an Action.

User Object has following properties - 

firstName
lastName
username
password
collection roles
projects


Roles data is no where displayed on the JSP page. Project data is
displayed but I am using the plain ids to render the select tag. In the
jsp the firstName, lastName, username, password properties are mapped to
user.firstNameand likewise. I have separate ListprojectIds
variable defined in the action class to get the selected projects ids.

After editing the user information when the form is submitted, I am
getting the firstName, lastName, username, password back in the user
object but I am loosing the roles and projects data populated in the
User object before rendering the page.

What is going wrong? Or is this the correct behavior? In order to retain
the collection values, what logic do I need to add?

Thanks!

P.S. A non struts related issue - whenever I am trying to send out an
email to the user group, my email is bouncing back and the error is - 

Your message did not reach some or all of the intended recipients.

  Subject:  Bean Properties are lost
  Sent: 12/19/2008 5:12 PM

The following recipient(s) cannot be reached:

  Struts Users Mailing List on 12/19/2008 5:13 PM
There was a SMTP communication problem with the recipient's
email server.  Please contact your system administrator.
<(my company's email server) #5.5.0 smtp;552 spam score
(7.5) exceeded threshold>



--
View this message in context:
http://www.nabble.com/Bean-Properties-are-lost-tp21099202p21099202.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Bean Properties are lost

2008-12-22 Thread Martin Gainty

Kevin-

if your scope is local that is the problem..the default scope is page *(so as 
soon as you switch page the variable is lost)*
try a more comprehensive scope such as application instead
Take a look at ScopeInterceptor to access the scoped atrributes
http://struts.apache.org/2.x/docs/scope-interceptor.html

Anyone ?
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




> Subject: RE: Bean Properties are lost
> Date: Mon, 22 Dec 2008 08:33:42 -0500
> From: biesbrock.ke...@aoins.com
> To: user@struts.apache.org
> CC: rich...@gmail.com
> 
>  
> Make sure you're putting everything in your jsp.  If the field doesn't
> need to be displayed, use the  tag.
> 
> The problem is with your internal mail server.  Your company's spam
> filter is viewing your email as spam; whether it be the destination or
> content in your message, I don't know.  See if they can add the
> destination to the whitelist (acceptable list).
> 
> Beez
> ( 4961 
> 
> -Original Message-
> From: Richa Pandharikar [mailto:rich...@gmail.com] 
> Sent: Friday, December 19, 2008 6:20 PM
> To: user@struts.apache.org
> Subject: Bean Properties are lost
> 
> 
> I have a User Object that I am using as a Bean in an Action.
> 
> User Object has following properties - 
> 
> firstName
> lastName
> username
> password
> collection roles
> projects
> 
> 
> Roles data is no where displayed on the JSP page. Project data is
> displayed but I am using the plain ids to render the select tag. In the
> jsp the firstName, lastName, username, password properties are mapped to
> user.firstNameand likewise. I have separate ListprojectIds
> variable defined in the action class to get the selected projects ids.
> 
> After editing the user information when the form is submitted, I am
> getting the firstName, lastName, username, password back in the user
> object but I am loosing the roles and projects data populated in the
> User object before rendering the page.
> 
> What is going wrong? Or is this the correct behavior? In order to retain
> the collection values, what logic do I need to add?
> 
> Thanks!
> 
> P.S. A non struts related issue - whenever I am trying to send out an
> email to the user group, my email is bouncing back and the error is - 
> 
> Your message did not reach some or all of the intended recipients.
> 
>   Subject:Bean Properties are lost
>   Sent:   12/19/2008 5:12 PM
> 
> The following recipient(s) cannot be reached:
> 
>   Struts Users Mailing List on 12/19/2008 5:13 PM
> There was a SMTP communication problem with the recipient's
> email server.  Please contact your system administrator.
> <(my company's email server) #5.5.0 smtp;552 spam score
> (7.5) exceeded threshold>
> 
> 
> 
> --
> View this message in context:
> http://www.nabble.com/Bean-Properties-are-lost-tp21099202p21099202.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
It’s the same Hotmail®. If by “same” you mean up to 70% faster.
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad1_122008

RE: I'm stuck

2008-12-22 Thread Dai Le
I've compiled the project both with the jdk 1.6._05 and jdk 1.5.0_17 they
both work fine deploying the project to Tomcat 6.0.18.  When I try to deploy
it to Tomcat 6.0.16, which is the version on my live server, the application
fails and I get the same error:

javax.servlet.ServletException: javax.servlet.jsp.JspException: Exception
creating bean of class com.ezlifesales.actionforms.ClientHealthInformation:
{1}

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
mpl.java:850)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:779)

org.apache.jsp.healthquestionaire_jsp._jspService(healthquestionaire_jsp.jav
a:1920)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
74)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

Is there anything I can do to get it to work on Tomcat 6.0.16?

Dai Le
Developer
Pinney Insurance Center, Inc.
2266 Lava Ridge Ct.
Roseville, CA 95661
(916)773-2800

-Original Message-
From: Martin Gainty [mailto:mgai...@hotmail.com] 
Sent: Saturday, December 20, 2008 4:24 PM
To: Struts Users Mailing List
Subject: RE: I'm stuck


I agree with Saul as these problems go away when compiling JDK5 (and deploy
to TC5)(compiling with JDK6 and deploying to TC6)
 
I would make sure you can compile the jsp page (and it produces the java
file) you should see the java file in Catalina's work folder e.g.
%TOMCAT_HOME%\work\Catalina\localhost\WebAppName\org\apache\jsp\index_jsp.ja
va
(you can jasper-compile using ANT's jspc task)
http://ant.apache.org/manual/OptionalTasks/jspc.html
HTHMartin __ Disclaimer and
confidentiality note Everything in this e-mail and any attachments relates
to the official business of Sender. This transmission is of a confidential
nature and Sender does not endorse distribution to any party other than
intended recipient. Sender does not necessarily endorse content contained
within this transmission. > Date: Sat, 20 Dec 2008 14:55:27 -0600> From:
y...@dataanvil.com> To: user@struts.apache.org> Subject: Re: I'm stuck> >
You may want to recompile your app using jdk 1.5.0 and re-deploy the new >
war or ear file on your live server.> > HTH,> Saul> > > Dai Le wrote:> > Hi,
I'm new to the list and this is my first time posting a question. Well> >
here it is.> >> > > >> > I'm a new web developer and this is my very first
site. I'm developing a> > new site with the struts framework, specifically
Struts 1.2.9 and I'm> > running into a bit of trouble. The site works fine
on my workstation and my> > test server, when I upload it to the live server
I get an error and I've> > tried Google but to no avail.> >> > > >> > Here
is the error message I get, I'll just post a piece of the stack trace:> >> >
> >> > javax.servlet.ServletException: javax.servlet.jsp.JspException:
Exception> > creating bean of class
com.ezlifesales.actionforms.ClientHealthInformation:> > {1}> >> > > >
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
> > mpl.java:850)> >> > > >
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
> > l.java:779)> >> > > >
org.apache.jsp.healthquestionaire_jsp._jspService(healthquestionaire_jsp.jav
> > a:1920)> >> >
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)> >> >
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)> >> > > >
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> > 74)> >> > > >
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)> >>
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)> >> >
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)> >> > > >> >
Just as I'm writing this message, I've been able to narrow the problem down>
> to the jdk. It seems that it is able to run on jdk 1.6.0 but not on jdk> >
1.5.0. Does anyone know how I can make it work on jdk 1.5.0., because
that's> > the version that is on my live server? > >> > > >> > Dai Le> >> >
Developer> >> > Pinney Insurance Center, Inc.> >> > 2266 Lava Ridge Ct.> >>
> Roseville, CA 95661> >> > (916)773-2800> >> > > >> >> >
> > Spam/Virus scanning by CanIt Pro> >> >
For more information see> > http://www.kgbinternet.com/SpamFilter.htm> >> >
To control your spam filter, log in at> > http://filter.kgbinternet.com> >>
> > > >
-> To
unsubscribe, e-mail: user-unsubscr...@struts.apache.org> For additional
commands, e-mail: user-h...@struts.apache.org> 
___

RE: Bean Properties are lost

2008-12-22 Thread Richa Pandharikar
I had tried to set the collection as a hidden property, but then I was
getting "invalid value" error when I submit the form. 

Please not I do not have any validation rules configured for the hidden
properties.

- Richa

-Original Message-
From: Biesbrock, Kevin [mailto:biesbrock.ke...@aoins.com] 
Sent: Monday, December 22, 2008 7:34 AM
To: Struts Users Mailing List
Cc: Richa Pandharikar
Subject: RE: Bean Properties are lost

 
Make sure you're putting everything in your jsp.  If the field doesn't
need to be displayed, use the  tag.

The problem is with your internal mail server.  Your company's spam
filter is viewing your email as spam; whether it be the destination or
content in your message, I don't know.  See if they can add the
destination to the whitelist (acceptable list).

Beez
( 4961 

-Original Message-
From: Richa Pandharikar [mailto:rich...@gmail.com] 
Sent: Friday, December 19, 2008 6:20 PM
To: user@struts.apache.org
Subject: Bean Properties are lost


I have a User Object that I am using as a Bean in an Action.

User Object has following properties - 

firstName
lastName
username
password
collection roles
projects


Roles data is no where displayed on the JSP page. Project data is
displayed but I am using the plain ids to render the select tag. In the
jsp the firstName, lastName, username, password properties are mapped to
user.firstNameand likewise. I have separate ListprojectIds
variable defined in the action class to get the selected projects ids.

After editing the user information when the form is submitted, I am
getting the firstName, lastName, username, password back in the user
object but I am loosing the roles and projects data populated in the
User object before rendering the page.

What is going wrong? Or is this the correct behavior? In order to retain
the collection values, what logic do I need to add?

Thanks!

P.S. A non struts related issue - whenever I am trying to send out an
email to the user group, my email is bouncing back and the error is - 

Your message did not reach some or all of the intended recipients.

  Subject:  Bean Properties are lost
  Sent: 12/19/2008 5:12 PM

The following recipient(s) cannot be reached:

  Struts Users Mailing List on 12/19/2008 5:13 PM
There was a SMTP communication problem with the recipient's
email server.  Please contact your system administrator.
<(my company's email server) #5.5.0 smtp;552 spam score
(7.5) exceeded threshold>



--
View this message in context:
http://www.nabble.com/Bean-Properties-are-lost-tp21099202p21099202.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Bean Properties are lost

2008-12-22 Thread Biesbrock, Kevin
I would guess, then, maybe chaining the actions or storing the
collections in a session variable.  Another idea would be to make the
collection a character delimited string and store that in a hidden
input.  Don't know what the best way is, though.

I'm interested to know the most efficient way as well. 


Beez
( 4961 

-Original Message-
From: Richa Pandharikar [mailto:richa.pandhari...@tdktech.com] 
Sent: Monday, December 22, 2008 12:21 PM
To: 'Struts Users Mailing List'
Subject: RE: Bean Properties are lost

I had tried to set the collection as a hidden property, but then I was
getting "invalid value" error when I submit the form. 

Please not I do not have any validation rules configured for the hidden
properties.

- Richa

-Original Message-
From: Biesbrock, Kevin [mailto:biesbrock.ke...@aoins.com]
Sent: Monday, December 22, 2008 7:34 AM
To: Struts Users Mailing List
Cc: Richa Pandharikar
Subject: RE: Bean Properties are lost

 
Make sure you're putting everything in your jsp.  If the field doesn't
need to be displayed, use the  tag.

The problem is with your internal mail server.  Your company's spam
filter is viewing your email as spam; whether it be the destination or
content in your message, I don't know.  See if they can add the
destination to the whitelist (acceptable list).

Beez
( 4961 

-Original Message-
From: Richa Pandharikar [mailto:rich...@gmail.com]
Sent: Friday, December 19, 2008 6:20 PM
To: user@struts.apache.org
Subject: Bean Properties are lost


I have a User Object that I am using as a Bean in an Action.

User Object has following properties - 

firstName
lastName
username
password
collection roles
projects


Roles data is no where displayed on the JSP page. Project data is
displayed but I am using the plain ids to render the select tag. In the
jsp the firstName, lastName, username, password properties are mapped to
user.firstNameand likewise. I have separate ListprojectIds
variable defined in the action class to get the selected projects ids.

After editing the user information when the form is submitted, I am
getting the firstName, lastName, username, password back in the user
object but I am loosing the roles and projects data populated in the
User object before rendering the page.

What is going wrong? Or is this the correct behavior? In order to retain
the collection values, what logic do I need to add?

Thanks!

P.S. A non struts related issue - whenever I am trying to send out an
email to the user group, my email is bouncing back and the error is - 

Your message did not reach some or all of the intended recipients.

  Subject:  Bean Properties are lost
  Sent: 12/19/2008 5:12 PM

The following recipient(s) cannot be reached:

  Struts Users Mailing List on 12/19/2008 5:13 PM
There was a SMTP communication problem with the recipient's
email server.  Please contact your system administrator.
<(my company's email server) #5.5.0 smtp;552 spam score
(7.5) exceeded threshold>



--
View this message in context:
http://www.nabble.com/Bean-Properties-are-lost-tp21099202p21099202.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] Using tag for choosing file (no uploading)

2008-12-22 Thread Milan Milanovic

And one more thing, when I click submit button on the form which contains
 it doesn't redirect to the page I defined in struts.xml for that
form action, it just remain on the page with the form?

--
Thx, M.


Milan Milanovic wrote:
> 
> Hi,
> 
> I need to use  tag just to select file in the system, but not to
> upload this file, I just want to get path to it, so that I can parse it in
> my action class. However when I put this tag in the  tag and try
> to select file, file was selected but I get an error in console about
> "missing multipart/form-data for enctype"! How can I remove this error ?
> 
> One another question, I want to user that he can enter new filename in a
> directory for exporting data, but I cannot use  for this because
> in that case I need existing file. Which tag should I use ?
> 
> --
> Thx, Milan
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Using-%3Cs%3Afile-%3E-tag-for-choosing-file-%28no-uploading%29-tp21125988p21133123.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] Using tag for choosing file (no uploading)

2008-12-22 Thread Dave Newton
The  tag is for uploading files. Period. It's not a general-purpose 
"enter a filename here" tag.

We just went through this (or at least tried to) with somebody else. You're 
getting the enctype message because a file upload demands a multipart encoding.

There is no tag for *downloading* a file. That's handled by the browser. There 
are any number of tutorials on the web for how to download a file from a web 
application. Struts 2 provides the "stream" response, or it can be done 
manually. The browser opens the save-or-open dialog box.

Dave

--- On Mon, 12/22/08, Milan Milanovic wrote:
And one more thing, when I click submit button on the form which contains
 it doesn't redirect to the page I defined in struts.xml for that
form action, it just remain on the page with the form?

--
Thx, M.


Milan Milanovic wrote:
> 
> Hi,
> 
> I need to use  tag just to select file in the system, but not to
> upload this file, I just want to get path to it, so that I can parse it in
> my action class. However when I put this tag in the  tag and try
> to select file, file was selected but I get an error in console about
> "missing multipart/form-data for enctype"! How can I remove this error ?
> 
> One another question, I want to user that he can enter new filename in a
> directory for exporting data, but I cannot use  for this because
> in that case I need existing file. Which tag should I use ?
> 
> --
> Thx, Milan
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Using-%3Cs%3Afile-%3E-tag-for-choosing-file-%28no-uploading%29-tp21125988p21133123.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] Using tag for choosing file (no uploading)

2008-12-22 Thread Milan Milanovic

Dear Dave,

thanks on response.


newton.dave wrote:
> 
> The  tag is for uploading files. Period. It's not a
> general-purpose "enter a filename here" tag.
> 
> We just went through this (or at least tried to) with somebody else.
> You're getting the enctype message because a file upload demands a
> multipart encoding.
> 

Thats is O.K.! I'm asking if S2 have some file chooser tag for this ?


newton.dave wrote:
> 
> There is no tag for *downloading* a file. That's handled by the browser.
> There are any number of tutorials on the web for how to download a file
> from a web application. Struts 2 provides the "stream" response, or it can
> be done manually. The browser opens the save-or-open dialog box.
> 

O.K. Can you post here any link for S2 "stream" response that I can see ?
Just one more thing, I need to enable "download" for 2 files in the same
time.

--
Best regards, Milan.


newton.dave wrote:
> 
> 
> Dave
> 
> --- On Mon, 12/22/08, Milan Milanovic wrote:
> And one more thing, when I click submit button on the form which contains
>  it doesn't redirect to the page I defined in struts.xml for that
> form action, it just remain on the page with the form?
> 
> --
> Thx, M.
> 
> 
> Milan Milanovic wrote:
>> 
>> Hi,
>> 
>> I need to use  tag just to select file in the system, but not to
>> upload this file, I just want to get path to it, so that I can parse it
>> in
>> my action class. However when I put this tag in the  tag and try
>> to select file, file was selected but I get an error in console about
>> "missing multipart/form-data for enctype"! How can I remove this error ?
>> 
>> One another question, I want to user that he can enter new filename in a
>> directory for exporting data, but I cannot use  for this because
>> in that case I need existing file. Which tag should I use ?
>> 
>> --
>> Thx, Milan
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/-S2--Using-%3Cs%3Afile-%3E-tag-for-choosing-file-%28no-uploading%29-tp21125988p21133123.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Using-%3Cs%3Afile-%3E-tag-for-choosing-file-%28no-uploading%29-tp21125988p21133637.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] Using tag for choosing file (no uploading)

2008-12-22 Thread Dave Newton
--- On Mon, 12/22/08, Milan Milanovic wrote:
> I'm asking if S2 have some file chooser tag for this?

No! File downloading is handled by the client!

> Can you post here any link for S2 "stream" response that I can see?

http://struts.apache.org/2.x/docs/stream-result.html

> I need to enable "download" for 2 files in the same time.

I know of no generalized, non-browser-specific way to do that. Maybe you could 
handle it w/ a meta-redirect after the current file is done downloading, I 
don't know.

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] Using tag for choosing file (no uploading)

2008-12-22 Thread Milan Milanovic

Dear Dave,


newton.dave wrote:
> 
> --- On Mon, 12/22/08, Milan Milanovic wrote:
>> I'm asking if S2 have some file chooser tag for this?
> 
> No! File downloading is handled by the client!
> 
> 

Actually, I'm asking here for choosing file on the disk, not downloading.


newton.dave wrote:
> 
>> Can you post here any link for S2 "stream" response that I can see?
> 
> http://struts.apache.org/2.x/docs/stream-result.html
> 
> 

O.K. Thanks. I must see how can I flush my file into output stream.

btw - do you maybe know why when file tag is in the  tag, form
action
doesn't redirect ?

--
Thx, .


-- 
View this message in context: 
http://www.nabble.com/-S2--Using-%3Cs%3Afile-%3E-tag-for-choosing-file-%28no-uploading%29-tp21125988p21134504.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] Using tag for choosing file (no uploading)

2008-12-22 Thread Dave Newton
> I'm asking here for choosing file on the disk, not downloading.

...

The file is going from the web application to the client, right?

That's downloading.

> btw - do you maybe know why when file tag is in the  tag, 
> form action doesn't redirect ?

Not without further information. I have no issues uploading files. Since you're 
not uploading a file, this shouldn't be an issue for you anyway.

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



how to access differenct form ?

2008-12-22 Thread shrimpywu

for all the action form, i create a super class for them, and contain some
info that i want to show onto page, suppose the menu, in the super class, i
got an variable say  : private Menu menu,

in the page, i want to create a jspf for menu, and all the page just need to
include it.
but for different page, the form is different, how can i read the same value
from different form?\


I am using struts 1.39.

Kind Thanks.
-- 
View this message in context: 
http://www.nabble.com/how-to-access-differenct-form---tp21136054p21136054.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] Using tag for choosing file (no uploading)

2008-12-22 Thread Milan Milanovic

Dear Dave,


newton.dave wrote:
> 
>> btw - do you maybe know why when file tag is in the  tag, 
>> form action doesn't redirect ?
> 
> Not without further information. I have no issues uploading files. Since
> you're not uploading a file, this shouldn't be an issue for you anyway.
> 
> 

Well, it is an issue, because when user submit the button on the form I
cannot redirect to to some other page, and it remain on that page where he
called submit button. An action is executed, but action result not.

--
Best regards, M.

-- 
View this message in context: 
http://www.nabble.com/-S2--Using-%3Cs%3Afile-%3E-tag-for-choosing-file-%28no-uploading%29-tp21125988p21136574.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] Using tag for choosing file (no uploading)

2008-12-22 Thread Dave Newton
You said it was an issue if you had an s:file tag. Since you don't need an 
s:file tag, it shouldn't be an issue.

If you still think it's an issue post the code and configs--I upload files all 
the time without any difficulties, so it's probably something straight-forward.

Dave

--- On Mon, 12/22/08, Milan Milanovic  wrote:

From: Milan Milanovic 
Subject: Re: [S2] Using  tag for choosing file (no uploading)
To: user@struts.apache.org
Date: Monday, December 22, 2008, 5:56 PM


Dear Dave,


newton.dave wrote:
> 
>> btw - do you maybe know why when file tag is in the  tag, 
>> form action doesn't redirect ?
> 
> Not without further information. I have no issues uploading files. Since
> you're not uploading a file, this shouldn't be an issue for you anyway.
> 
> 

Well, it is an issue, because when user submit the button on the form I
cannot redirect to to some other page, and it remain on that page where he
called submit button. An action is executed, but action result not.

--
Best regards, M.

-- 
View this message in context: 
http://www.nabble.com/-S2--Using-%3Cs%3Afile-%3E-tag-for-choosing-file-%28no-uploading%29-tp21125988p21136574.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



About Struts Rest Plugin

2008-12-22 Thread Luis Gervaso
I'm wondering why not the behaviour of the rest plugin is ...

*For example*

URL:
http://www.domain.com/myapp/restController/resource1/resource2/resource3/resource4/resource5

creates a mapping parent & child

i.e:

parentId: resource1/resource2/resource3/resource4
childId: resource5

these can be obtained from request URI

now in the logic of the RestController we are aware to map these ids (really
paths) with the model

ParentObject - getFrom(parentId)
ChildObject - getFrom(childId)

This way to create new rest services we have to extend this base class

*Another example*

http://www.domain.com/myapp/restController/resource1/resource2/resource3/resource4/editNew

parentId : resource1/resource2/resource3/resource4
childId: a new ModelObject from the specific restController (which extends
BaseRestController)

*The create method *

uses the post request parameters for the child
uses the url to locate the parent

I have put here childId or parentId, BUT really are ChildPath or ParentPath
(the ids are for databases)

if we need to use this concept may be more appropiate to use the term
"Reference"

Thanks for readme

Luis
-- 
---
Luis Alberto Gervaso Martin
Java EE Architect & Instructor
C/ Cuenca 4A, 2ºB
Getafe (Madrid)
SPAIN
mobile: (+34) 627983344
luis.gerv...@gmail.com


Re: [S2] apply i18n on java entity from DB

2008-12-22 Thread Steven Yang
>
> Thanks a lot


No problem about the code
I get your point clearly.

I will definitely take this in to consideration.

I guess I need to look back into my design patterns as well ha

If anyone else have any thoughts or suggestion please fill free to hit me

Thanks


How to assign a index value of to a int variable.

2008-12-22 Thread taj uddin
Hi,

In my application I want to assign the value of the status attribute of 
 tag to the int variable.
In clear(explanation):-I have the this code(below)


I have tried to get the index value of the current iteration with the help of 
index() method.
where #idx.index() gives the index value. Now i want to assign this value to 
the int variable.

Can u pls help me out in this issue.





  

Re: About Struts Rest Plugin

2008-12-22 Thread Luis Gervaso
I have been trying to figure the solution,

I'm using convention plugin and i need to map first every first child of
http://www.domain.com/myapp/restController/to
a "restaction"

so

http://www.domain.com/myapp/restController/fileSystem/folder1/folder2/folder3/file1
http://www.domain.com/myapp/restController/fileSystem/folder1/folder2/folder3/file2

both to FileSystemRestController (which inherit from AbstractRestController)

AND

http://www.domain.com/myapp/restController/roles/user1/role1/subrole1
http://www.domain.com/myapp/restController/roles/user2/role1/subrole1
http://www.domain.com/myapp/restController/roles/user3/role1/subrole2

both to RolesRestController

these are just an example

the main purpose of this is be able to use

curl -X POST
http://www.domain.com/myapp/restController/roles/user1/role1/subrole1/othermorerole

and create othermorerole under
http://www.domain.com/myapp/restController/roles/user1/role1/subrole1



On Tue, Dec 23, 2008 at 3:05 AM, Luis Gervaso wrote:

> I'm wondering why not the behaviour of the rest plugin is ...
>
> *For example*
>
> URL:
> http://www.domain.com/myapp/restController/resource1/resource2/resource3/resource4/resource5
>
> creates a mapping parent & child
>
> i.e:
>
> parentId: resource1/resource2/resource3/resource4
> childId: resource5
>
> these can be obtained from request URI
>
> now in the logic of the RestController we are aware to map these ids
> (really paths) with the model
>
> ParentObject - getFrom(parentId)
> ChildObject - getFrom(childId)
>
> This way to create new rest services we have to extend this base class
>
> *Another example*
>
>
> http://www.domain.com/myapp/restController/resource1/resource2/resource3/resource4/editNew
>
> parentId : resource1/resource2/resource3/resource4
> childId: a new ModelObject from the specific restController (which extends
> BaseRestController)
>
> *The create method *
>
> uses the post request parameters for the child
> uses the url to locate the parent
>
> I have put here childId or parentId, BUT really are ChildPath or ParentPath
> (the ids are for databases)
>
> if we need to use this concept may be more appropiate to use the term
> "Reference"
>
> Thanks for readme
>
> Luis
> --
> ---
> Luis Alberto Gervaso Martin
> Java EE Architect & Instructor
> C/ Cuenca 4A, 2ºB
> Getafe (Madrid)
> SPAIN
> mobile: (+34) 627983344
> luis.gerv...@gmail.com
>



-- 
---
Luis Alberto Gervaso Martin
Java EE Architect & Instructor
C/ Cuenca 4A, 2ºB
Getafe (Madrid)
SPAIN
mobile: (+34) 627983344
luis.gerv...@gmail.com


Re: About Struts Rest Plugin

2008-12-22 Thread Luis Gervaso
OK with convention plugin is possible to do

code from RestAction

@Action(value="/rest/*",
result...@result(name=BaseAction.SUCCESS,
location="/WEB-INF/content/rest-success.jsp")}
)
public final String execute() {
System.out.println();
System.out.println("PARENT : " + getParentPath());
System.out.println("RESOURCE : " + getResourceName());


//examine http method and other stuff

return HttpBaseAction.SUCCESS;
}

now the requestURI returns

/contextPath/rest/folder1/folder2/folder3/file1

contextPath is fixed length OK
rest is annotated (is possible access without reflection? may be from the
current ActionContext?) 
getParentPath returns folder1/folder2/folder3 (from /* to last /) OK
getResourceName file1

Here is the fast code for getParentPath() and getResourceName() [UNSOLVED
the Action current name]

protected String getRequestURI() {
String uri = getRequest().getRequestURI();
return (uri.charAt(uri.length() - 1) == '/') ?
uri.substring(0,uri.length() - 1) : uri;
}

protected String getParentPath() {
String parentPath =
getRequestURI().substring(getContextPath().length(),getRequestURI().lastIndexOf('/'));
if (parentPath.length() < 1) parentPath = "/";
return parentPath;
}

protected String getResourceName() {
String resourceName =
getRequestURI().substring(getContextPath().concat(getParentPath()).length());
return resourceName.charAt(0) == '/' ? resourceName.substring(1) :
resourceName;
}




On Tue, Dec 23, 2008 at 6:45 AM, Luis Gervaso wrote:

> I have been trying to figure the solution,
>
> I'm using convention plugin and i need to map first every first child of
> http://www.domain.com/myapp/restController/to
>  a "restaction"
>
> so
>
>
> http://www.domain.com/myapp/restController/fileSystem/folder1/folder2/folder3/file1
>
> http://www.domain.com/myapp/restController/fileSystem/folder1/folder2/folder3/file2
>
> both to FileSystemRestController (which inherit from
> AbstractRestController)
>
> AND
>
> http://www.domain.com/myapp/restController/roles/user1/role1/subrole1
> http://www.domain.com/myapp/restController/roles/user2/role1/subrole1
> http://www.domain.com/myapp/restController/roles/user3/role1/subrole2
>
> both to RolesRestController
>
> these are just an example
>
> the main purpose of this is be able to use
>
> curl -X POST
> http://www.domain.com/myapp/restController/roles/user1/role1/subrole1/othermorerole
>
> and create othermorerole under
> http://www.domain.com/myapp/restController/roles/user1/role1/subrole1
>
>
>
>
> On Tue, Dec 23, 2008 at 3:05 AM, Luis Gervaso wrote:
>
>> I'm wondering why not the behaviour of the rest plugin is ...
>>
>> *For example*
>>
>> URL:
>> http://www.domain.com/myapp/restController/resource1/resource2/resource3/resource4/resource5
>>
>> creates a mapping parent & child
>>
>> i.e:
>>
>> parentId: resource1/resource2/resource3/resource4
>> childId: resource5
>>
>> these can be obtained from request URI
>>
>> now in the logic of the RestController we are aware to map these ids
>> (really paths) with the model
>>
>> ParentObject - getFrom(parentId)
>> ChildObject - getFrom(childId)
>>
>> This way to create new rest services we have to extend this base class
>>
>> *Another example*
>>
>>
>> http://www.domain.com/myapp/restController/resource1/resource2/resource3/resource4/editNew
>>
>> parentId : resource1/resource2/resource3/resource4
>> childId: a new ModelObject from the specific restController (which extends
>> BaseRestController)
>>
>> *The create method *
>>
>> uses the post request parameters for the child
>> uses the url to locate the parent
>>
>> I have put here childId or parentId, BUT really are ChildPath or
>> ParentPath (the ids are for databases)
>>
>> if we need to use this concept may be more appropiate to use the term
>> "Reference"
>>
>> Thanks for readme
>>
>> Luis
>> --
>> ---
>> Luis Alberto Gervaso Martin
>> Java EE Architect & Instructor
>> C/ Cuenca 4A, 2ºB
>> Getafe (Madrid)
>> SPAIN
>> mobile: (+34) 627983344
>>  luis.gerv...@gmail.com
>>
>
>
>
> --
> ---
> Luis Alberto Gervaso Martin
> Java EE Architect & Instructor
> C/ Cuenca 4A, 2ºB
> Getafe (Madrid)
> SPAIN
> mobile: (+34) 627983344
> luis.gerv...@gmail.com
>



-- 
---
Luis Alberto Gervaso Martin
Java EE Architect & Instructor
C/ Cuenca 4A, 2ºB
Getafe (Madrid)
SPAIN
mobile: (+34) 627983344
luis.gerv...@gmail.com


Re: About Struts Rest Plugin

2008-12-22 Thread Luis Gervaso
The reflection impl

import java.lang.reflect.Method;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;


public class RestAction extends HttpBaseAction {

@Action(value="/rest/*",
result...@result(name=HttpBaseAction.SUCCESS,
location="/WEB-INF/content/rest-success.jsp")}
)
public final String execute() throws Exception {
System.out.println();
System.out.println("PARENT : " + getParentPath());
System.out.println("RESOURCE : " + getResourceName());
return HttpBaseAction.SUCCESS;
}

// GET /rest/1
public String show() {
return HttpBaseAction.SUCCESS;
}

// GET /rest/
public String index() {

//list = ordersService.getAll();
return HttpBaseAction.SUCCESS;
}

// POST /rest
public String create() {
System.out.println("create " + getResourceName());
//ordersService.save(model);
addActionMessage("New order created successfully");
return HttpBaseAction.SUCCESS;
}

public String getParentPath() throws SecurityException,
NoSuchMethodException {
Method m = this.getClass().getMethod("execute", null);
Action aa = m.getAnnotation(Action.class);
int valueLength = aa.value().substring(0,
aa.value().lastIndexOf('/')).length();
String parentPath =
getRequestURI().substring(getContextPath().length() + valueLength,
getRequestURI().lastIndexOf('/'));
return parentPath;
}

public String getResourceName() {
return getRequestURI().substring(getRequestURI().lastIndexOf('/') +
1);
}


}

The output:

curl http://localhost:8080/context/rest/2/1/4553/45

PARENT : /2/1/4553
RESOURCE : 45

On Tue, Dec 23, 2008 at 7:25 AM, Luis Gervaso wrote:

> OK with convention plugin is possible to do
>
> code from RestAction
>
> @Action(value="/rest/*",
> result...@result(name=BaseAction.SUCCESS,
> location="/WEB-INF/content/rest-success.jsp")}
> )
> public final String execute() {
> System.out.println();
> System.out.println("PARENT : " + getParentPath());
> System.out.println("RESOURCE : " + getResourceName());
>
>
> //examine http method and other stuff
>
> return HttpBaseAction.SUCCESS;
> }
>
> now the requestURI returns
>
> /contextPath/rest/folder1/folder2/folder3/file1
>
> contextPath is fixed length OK
> rest is annotated (is possible access without reflection? may be from the
> current ActionContext?) 
> getParentPath returns folder1/folder2/folder3 (from /* to last /) OK
> getResourceName file1
>
> Here is the fast code for getParentPath() and getResourceName() [UNSOLVED
> the Action current name]
>
> protected String getRequestURI() {
> String uri = getRequest().getRequestURI();
> return (uri.charAt(uri.length() - 1) == '/') ?
> uri.substring(0,uri.length() - 1) : uri;
> }
>
> protected String getParentPath() {
> String parentPath =
> getRequestURI().substring(getContextPath().length(),getRequestURI().lastIndexOf('/'));
> if (parentPath.length() < 1) parentPath = "/";
> return parentPath;
> }
>
> protected String getResourceName() {
> String resourceName =
> getRequestURI().substring(getContextPath().concat(getParentPath()).length());
> return resourceName.charAt(0) == '/' ? resourceName.substring(1) :
> resourceName;
>
> }
>
>
>
>
> On Tue, Dec 23, 2008 at 6:45 AM, Luis Gervaso wrote:
>
>> I have been trying to figure the solution,
>>
>> I'm using convention plugin and i need to map first every first child of
>> http://www.domain.com/myapp/restController/to
>>  a "restaction"
>>
>> so
>>
>>
>> http://www.domain.com/myapp/restController/fileSystem/folder1/folder2/folder3/file1
>>
>> http://www.domain.com/myapp/restController/fileSystem/folder1/folder2/folder3/file2
>>
>> both to FileSystemRestController (which inherit from
>> AbstractRestController)
>>
>> AND
>>
>> http://www.domain.com/myapp/restController/roles/user1/role1/subrole1
>> http://www.domain.com/myapp/restController/roles/user2/role1/subrole1
>> http://www.domain.com/myapp/restController/roles/user3/role1/subrole2
>>
>> both to RolesRestController
>>
>> these are just an example
>>
>> the main purpose of this is be able to use
>>
>> curl -X POST
>> http://www.domain.com/myapp/restController/roles/user1/role1/subrole1/othermorerole
>>
>> and create othermorerole under
>> http://www.domain.com/myapp/restController/roles/user1/role1/subrole1
>>
>>
>>
>>
>> On Tue, Dec 23, 2008 at 3:05 AM, Luis Gervaso wrote:
>>
>>> I'm wondering why not the behaviour of the rest plugin is ...
>>>
>>> *For example*
>>>
>>> URL:
>>> http://www.domain.com/myapp/restController/resource1/resource2/resource3/resource4/resource5
>>>
>>> creates a mapping parent & child
>>>
>>> i.e:
>>>
>>> parentId: resource1/res

Re: How to assign a index value of to a int variable.

2008-12-22 Thread Nils-Helge Garli Hegvik
This works for me:





Nils-H

On Tue, Dec 23, 2008 at 6:00 AM, taj uddin  wrote:
> Hi,
>
> In my application I want to assign the value of the status attribute of 
>  tag to the int variable.
> In clear(explanation):-I have the this code(below)
>
> 
> I have tried to get the index value of the current iteration with the help of 
> index() method.
> where #idx.index() gives the index value. Now i want to assign this value to 
> the int variable.
>
> Can u pls help me out in this issue.
>
>
>
>
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



https://issues.apache.org/struts/browse/WW-2430

2008-12-22 Thread Ramakrishna R Allam
Hi All,

 

I am facing an issue with the ajax div and file upload in the same form
(getting object HTMLDocument in place of the ajax div). 

 

But when use iframe to display the file upload, I am able to display
both. But not able to submit the file as it is in the iframe. - this
looks like a wrong approach to me. 

 

Anybody please suggest me if they got any solution/ work around to the
above bug(https://issues.apache.org/struts/browse/WW-2430 )

 

Regards,

Ramakrishna


This email is sent for and on behalf of Ivy Comptech Private Limited. Ivy 
Comptech Private Limited is a limited liability company.  

This email and any attachments are confidential, and may be legally privileged 
and protected by copyright. If you are not the intended recipient dissemination 
or copying of this email is prohibited. If you have received this in error, 
please notify the sender by replying by email and then delete the email 
completely from your system. 
Any views or opinions are solely those of the sender.  This communication is 
not intended to form a binding contract on behalf of Ivy Comptech Private 
Limited unless expressly indicated to the contrary and properly authorised. Any 
actions taken on the basis of this email are at the recipient's own risk.

Registered office:
Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills, 
Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994. Registered 
in India. A list of members' names is available for inspection at the 
registered office.



RE: https://issues.apache.org/struts/browse/WW-2430

2008-12-22 Thread Ravichandra C
Hi,

To the extent my knowledge goes Ajax cannot handler fileuploads. Even if
it does it does it by an iframe. I recommend u to go with an iframe.
DOJO has many problems I faced with ajax validations.. and now I do it
with my own framework. 

Regards,
Ravi 

-Original Message-
From: Ramakrishna R Allam [mailto:ramakrish...@ivycomptech.com] 
Sent: Tuesday, December 23, 2008 1:00 PM
To: user@struts.apache.org
Subject: https://issues.apache.org/struts/browse/WW-2430

Hi All,

 

I am facing an issue with the ajax div and file upload in the same form
(getting object HTMLDocument in place of the ajax div). 

 

But when use iframe to display the file upload, I am able to display
both. But not able to submit the file as it is in the iframe. - this
looks like a wrong approach to me. 

 

Anybody please suggest me if they got any solution/ work around to the
above bug(https://issues.apache.org/struts/browse/WW-2430 )

 

Regards,

Ramakrishna


This email is sent for and on behalf of Ivy Comptech Private Limited.
Ivy Comptech Private Limited is a limited liability company.  

This email and any attachments are confidential, and may be legally
privileged and protected by copyright. If you are not the intended
recipient dissemination or copying of this email is prohibited. If you
have received this in error, please notify the sender by replying by
email and then delete the email completely from your system. 
Any views or opinions are solely those of the sender.  This
communication is not intended to form a binding contract on behalf of
Ivy Comptech Private Limited unless expressly indicated to the contrary
and properly authorised. Any actions taken on the basis of this email
are at the recipient's own risk.

Registered office:
Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills,
Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
Registered in India. A list of members' names is available for
inspection at the registered office.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Pls convert this code using struts2 tags

2008-12-22 Thread Nils-Helge Garli Hegvik
Yikeshow hard is it to read curly braces and numbers... Could
someone please sponsor me a pair of new glasses?

Your "Index" values should read: "%{#idx.index + 3}" etc (note the
number is inside the expression). Actually, I think you can skip the
curly braces as well.

Nils-H


On Mon, Dec 22, 2008 at 2:27 PM, Nils-Helge Garli Hegvik
 wrote:
> I aparently cannot read, your indexes does look correct after all,
> although maybe not needed... Sorry about that. I also didn't notice
> until now that parts of the code is outside the s:iterator loop.
> Seeing some of the generated html that doesn't work compared to what
> does work could help.
>
> Nils-H
>
> On Mon, Dec 22, 2008 at 11:53 AM, taj uddin  wrote:
>> Can u pls suggest me on how to use Index as a variable?
>>
>> Let me explain u in clear abt the application.
>> From my stuts1.2 code u can understand that in  index value
>> of iteration is stored in a variable "Index" and the value in that variable
>> is incremented using JSP tags.
>>
>> But using struts2, the status attribute of  tag holds the index
>> value of current iteration and i am trying to get that using index()
>> method.So, how can i asign the value that the status attribut is holding to
>> an ordinary where which can b used in JSP tags?
>>
>> --- On Mon, 12/22/08, Nils-Helge Garli Hegvik  wrote:
>>
>> From: Nils-Helge Garli Hegvik 
>> Subject: Re: Pls convert this code using struts2 tags
>> To: tajuddi...@yahoo.com, "Struts Users Mailing List"
>> 
>> Date: Monday, December 22, 2008, 5:23 AM
>>
>> That's hard to say considering I know nothing about what result you
>> expect, and what the rendered html actually looks like. But from your
>> code, it looks like the "Index1", "Index2" and
>> "Index3" variables
>> might not have the value you expect them to be. And do you really need
>> to store the index in a variable?
>>
>> Nils-H
>>
>> On Mon, Dec 22, 2008 at 11:11 AM, taj uddin  wrote:
>>>
>>> Hey I have tried using  and  tags. By using
>> them, i am
>>> not getting any error but my required Menu is not appearing on the header
>>> page.
>>> Here is the code:
>>>  //Sub Menu for 2nd Main Menu Item ("ABC"):
>>> menus[1] = new
>>>
>>  menu(180, "vertical", 0, 0, -1, -1, "",
>> "#ce122d", "Verdana,Helvetica", 8,
>>>
>> "normal",
>>> "normal", "white", "#fcccb5", 1,
>> "#ce122d", 2, 62, false, true, false,
>>> false, 0, true, 4, 4, "black");
>>>
>>> >> name="Index" value="0" />
>>>
>>> >> value="%{#session.Tables}" status="idx"
>> id="Table" >
>>> >> name="Index" value="%{#idx.index}+3" />" />
>>>
>>>
>>> menus[1].addItem("#", "", 20, "left",
>> '>> />', '');
>>>
>> 
>>>
>> >> name="Index1" value="%{#Index}+1" />
>>>
>>> menus[1].addItem("#", "", 20, "left",
>> "PQR",'>> value="#Index1"/>');
>>> >> name="Index2" value="%{#Index1}+1" />
>>>
>>> menus[1].addItem("#", "", 20, "left",
>> "DEF", '>> />');
>>> >> name="Index3" value="%{#Index2}+1"/>
>>>
>>> menus[1].addItem("#", "", 20, "left",
>> "XYZ", '>> />');
>>>
>>> On the jsp page it is not displaying this menu.
>>> So, pls help me out
>>> --- On Mon, 12/22/08, Nils-Helge Garli Hegvik 
>> wrote:
>>>
>>> From: Nils-Helge Garli Hegvik 
>>>
>>  Subject: Re: Pls convert this code using struts2 tags
>>> To: "Struts Users Mailing List" ,
>>> tajuddi...@yahoo.com
>>> Date: Monday, December 22, 2008, 5:04 AM
>>>
>>> Take a look at the s:set and s:property tags.
>>>
>>> Nils-H
>>>
>>> On Mon, Dec 22, 2008 at 10:56 AM, taj uddin 
>> wrote:
 Hi

 I am working on application where i have to convert the code developed
>> in
>>> struts1.2 to struts2.0.
 Here is the struts1.2 code:
  //Sub Menu for 2nd Main Menu Item ("ABC"):
 menus[1] =
>> new
>>> menu(180, "vertical", 0, 0, -1, -1, "",
>> "#ce122d",
>>> "Verdana,Helvetica", 8,

>>> "normal", "normal", "white",
>> "#fcccb5",
>>> 1, "#ce122d", 2, 62, false, true, false, false, 0, true, 4, 4,
>>>
>>  "black");
 <% int
>>> Index = 0; %>

>>> >>  id="Table"
>>> name="Tables" scope="session">
 <%
>>> Index = idx.intValue() + 3; %>

>>> menus[1].addItem("#", "", 20, "left",
>>> ">> property="tableName"/>", <%=Index%>);

>>> 
 <%
>> Index++;
>>> %>

>>> menus[1].addItem("#", "", 20, "left",
>>> "PQR", <%=Index%>);
 <%
>> Index++;
>>> %>

>>> me