Update file problem..

2009-07-13 Thread hilal ceyhan
Hi everbody,
In my project i have a user informations.These information includes file in
database.
When i want to update user information i get an error about file update.If i
choose
new image file and then update it is not problem.But i don't choose new file
and then update
it's problem.

My user  UpdateTemplate.jsp file
..

..

My UserForm.java
..
private PersonForm personForm = new PersonForm();
..

My PersonForm.java
..
private Blob blobObject;
private File file ;
private String photographName;

public Person getPojoWithIds() throws IllegalAccessException,
InvocationTargetException, ParseException, FileNotFoundException,
IOException{
Person person= new Person();

BeanUtils.copyProperties(person, this);

if(getBornDateString() != null){
person.setBornDate(new
java.sql.Date(getBornDateString().getTime()));
}
Contact contact =new Contact();
contact.setId(getContactForm().getId());
person.setContact(contact);

RowStatus rowStatus = new RowStatus();
rowStatus.setId(getRowStatusForm().getId());
person.setRowStatus(rowStatus);

Language language = new Language();
language.setId(getLanguageForm().getId());
person.setLanguage(language);


if(this.getFile()!=null){
person.setBlobObject(Hibernate.createBlob(new
FileInputStream(this.getFile(;
}

return person;
}

...

I get this error.
Error Message

C:\Documents and
Settings\hilal\Desktop\yeni\eclipse_win_ganymede\projeler\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\work\Catalina\localhost\YazmanakWeb\upload__7267d08a_12277d9548c__8000_0058.tmp
(The system cannot find the file specified)


i understand while i get information from database i can't get file so while
update  tag get a different value.I don't understand this situation.

Please help me about this problem.


JSON Plugin and S:Action

2009-07-13 Thread Chris Pratt
I'm having a problem using  with an action
whose result type is json.  It doesn't insert the results.  My Action is
something like:

public class InitCalendarAction {
  private List> json;

  /**
   * Get the JSON Object to be Serialized
   *
   * @return JSON Object
   */
  public Object getJson () {
return json;
  } //getJson

  /**
   * Prepare the Object to be Serialized using JSON
   *
   * @return "success";
   */
  public String execute () {
Category cat;
Category[] daily = user.getPlan().getDailyCategories();
Calendar cal = Calendar.getInstance();
cal.set(Calendar.DATE,1);
int first = cal.get(Calendar.DAY_OF_WEEK) - 1;
List row;
json = new ArrayList>();
for(int day = 1;day <= cal.getMaximum(Calendar.DATE);day++) {
  row = new ArrayList();
  row.add("true");
  cat = daily[(day + first) % 7];
  row.add(cat.name().toLowerCase());
  row.add(cat.name());
  json.add(row);
}
return "success";
  } //execute

} //*InitCalendarAction

I have the action defined as:


  
json
  


In my JSP, I have:

var hilights = "";

But instead of the expected:

var hilights = "[ [ "true", "cardio", "Cardio"], [ "true", "upperbody",
"Upper Body"] ... ]";

I get:
var hilights = "";

There are no errors in the logs and when I write out each row in the array,
everything is there as expected, but there's just no output.  Any idea's
why?
  (*Chris*)


Re: exception :java.lang.NoClassDefFoundError: org/apache/commons/digester/RuleSet

2009-07-13 Thread Lukasz Lenart
2009/7/14 jayadevan :
> i am using struts 1 in my project . when i sart tomcat i got the following
> exception
> Jul 14, 2009 10:39:05 AM org.apache.catalina.core.ApplicationDispatcher
> invoke
> SEVERE: Allocate exception for servlet action
> java.lang.NoClassDefFoundError: org/apache/commons/digester/RuleSet
>        at java.lang.Class.getDeclaredConstructors0(Native Method)
>        at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
>        at java.lang.Class.getConstructor0(Unknown Source)
>        at java.lang.Class.newInstance0(Unknown Source)
>        at java.lang.Class.newInstance(Unknown Source)

I don't see any connection with Struts in logs, could you remove that
application and start Tomcat again? You're probably missing Digester
library needed by Tomcat.


Regards
-- 
Lukasz
http://www.lenart.org.pl/
http://dailylog.lenart.org.pl/

Timothy Leary  - "Women who seek to be equal with men lack ambition."
- http://www.brainyquote.com/quotes/authors/t/timothy_leary.html

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



Re: Migration from Struts1 to Struts2

2009-07-13 Thread Lasantha Pambagoda
Dear Martin,

Thanks for your link, We have went through the document and here are
the description on each item described in document.

1) Turn off logging and devMode - Already done this.
2) Use the Java Templates - Since we are not using struts tags this is
not applicable (right now we are only using struts only fore
dispatching purpose, our jsp's only use plain "c:out" tags).
3) Do not use interceptors you do not need. - We are not using any
struts interceptors.
4) Use the correct HTTP headers (Cache-Control & Expires) - We are not
using browser caching for html generated from JSP.
5) Copy the static content from the Struts 2 jar when using the Ajax
theme (Dojo) or the Calendar tag - We are not using ajax theme or
calendar tag.
6) Create a freemarker.properties file in your WEB-INF/classes
directory - We are not using Freemarker
7) Enable Freemarker template caching - We are not using freemaker
8) When overriding a theme, copy all necessary templates to the theme
directory - We are not overriding themes.
9) Do not create sessions unless you need them - We are not creating
sessions using struts2.
10) When using Freemarker, try to use the Freemarker equivalent rather
than using the JSP tags - We are not using any Freemarker
functionalities.

As further explanation we are only using sturs2 only for dispatching
purposes, Our action classes are simple like this.

@Namespace(S2Constants.Namespace.PRIVATE)
@Results ( {
@Result(name=S2Constants.Result.SUCCESS,
value=S2Constants.Jsp.MY_SUCCESS_JSP_FILE),
@Result(name=S2Constants.Result.ERROR, 
value=S2Constants.Jsp.MY_ERROR_JSP_FILE)
})
public class MyAction implements ServletRequestAware {

protected HttpServletRequest request;

public void setServletRequest(HttpServletRequest request) {
this.request = request;
}

public String execute() {
return MyRequestHandler.execute(request);
}
}

And out struts.xml file is like this.







Finally here is the web.xml configurations



struts2

org.apache.struts2.dispatcher.FilterDispatcher

  config
  
struts-default.xml,struts-plugin.xml,resources/struts2/struts.xml


actionPackages
com.myapplication.core.web.action
   




struts2
*.action
REQUEST
FORWARD



Additionally we have added two more servers in to our production
servers to avoid overloading. But still its getting overloaded time to
time. Same application before struts2 migration we managed to keep the
system in good health with two servers. (now we are having 4 servers
load balanced by hardware load balancer)

Really appreciate if anyone can help regarding this struts2 CPU
utilization issue.

Best Regards
Lasantha


On Mon, Jul 13, 2009 at 6:56 PM, Martin Gainty wrote:
>
> take a look at tuning tips described at
> http://cwiki.apache.org/WW/performance-tuning.html
>
> ping back for questions/concerns
> Martin
> __
> Verzicht und Vertraulichkeitanmerkung
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich 
> dem Austausch von Informationen und entfaltet keine rechtliche 
> Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen 
> wir keine Haftung fuer den Inhalt uebernehmen.
>
>
>
>
>
>
>> Date: Mon, 13 Jul 2009 06:31:34 -0700
>> From: tajuddi...@yahoo.com
>> Subject: Re: Migration from Struts1 to Struts2
>> To: user@struts.apache.org
>>
>> I'm not sure but do pls check out by including the sitemesh-2.3.jar file and 
>> xwork-2.0.6.jar file in your library
>>
>> --- On Mon, 7/13/09, Lasantha Pambagoda  wrote:
>>
>>
>> From: Lasantha Pambagoda 
>> Subject: Migration from Struts1 to Struts2
>> To: user@struts.apache.org
>> Date: Monday, July 13, 2009, 6:33 AM
>>
>>
>> Hi,
>>
>> We have migrated struts1 application to struts2. But now once we
>> deployed the system the CPU is going 90% to 100% and system is getting
>> loaded. In JSP's we are not using struts specific tags or freemaker
>> templates. Our JSP files are just plain jsp files only with
>> requstScope variables.
>>
>> We are using following versions of struts and dependent libraries.
>>
>> struts2-core-2.1.6.jar
>> struts2-codebehind-plugin-2.1.6.jar
>> ognl-2.6.11.jar
>> freemarker-2.3.13.jar
>>
>> Please let me know if we can do any improvement with out switching
>> back to struts1
>>
>> Kind Regards
>> Lasantha
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>>
>>
>
> __

exception :java.lang.NoClassDefFoundError: org/apache/commons/digester/RuleSet

2009-07-13 Thread jayadevan

hi all

i am using struts 1 in my project . when i sart tomcat i got the following
exception
Jul 14, 2009 10:39:05 AM org.apache.catalina.core.ApplicationDispatcher
invoke
SEVERE: Allocate exception for servlet action
java.lang.NoClassDefFoundError: org/apache/commons/digester/RuleSet
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1104)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:623)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
at
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:694)
at
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:665)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:61)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
pls help me

thanks in advance 



-- 
View this message in context: 
http://www.nabble.com/exception-%3Ajava.lang.NoClassDefFoundError%3A-org-apache-commons-digester-RuleSet-tp24473857p24473857.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: For s:textfield tag how to get value for title attribute from resource bundle.

2009-07-13 Thread wkbutler

Yep I did find that, thanks.  What I've realized is that I have the OGNL
double-evaluation problem.  I'm really trying to get this result for the
s:textfield label:

  label="%{getText('%{formQuestion.question.questionKey}')}" 

which of course is not legal, but I guess I'm somewhat surprised that 

  label="getText('%{formQuestion.question.questionKey}')" 

doesn't get what I need, even though I guess it's technically identical to
the previous AFAIK.  The struts docs here
(http://struts.apache.org/2.1.6/docs/tag-syntax.html)  are a little vague on
this layered use, but I am seeing if I can get some insight from the OGNL
docs (http://www.opensymphony.com/ognl/html/LanguageGuide/paren.html).  

I did try a helper tag like

   

but no luck.

Thanks for wading through my babble. I had my kids in the office today.  lol

-- 
View this message in context: 
http://www.nabble.com/For-s%3Atextfield-tag-how-to-get-value-for-title-attribute-from-resource-bundle.-tp15634305p24473204.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: updating or deleting a component from a collection through display tag

2009-07-13 Thread Dimitrios Christodoulakis
Great, many thanks again for the information. I bet others will find
it pretty handy too!

On Mon, Jul 13, 2009 at 9:23 PM, Musachy Barroso wrote:
> you can sue that notation anywhere. A tip that will save you a lot of
> time, always wrap the OGNl expressions with %{}, that's why the first
> hidden is not getting evaluated. The second one has an empty value
> because "goalToAchieve" is probably not pointing to anything.
>
> btw what #attr does is search for a value in all scopes (page,
> request, session , application)
>
> musahcy
>
> On Mon, Jul 13, 2009 at 5:57 PM, Dimitrios
> Christodoulakis wrote:
>> Thanks again for helping out Musachy,
>> I was wondering if there are any rules regarding when the notation you
>> suggested below can be used. it works perfectly for setting url
>> params.
>>
>> I was trying to use it (with struts2 tags) within a form (which is
>> within the display:column tag) to pass the value to an action:
>>
>> 
>>        
>>        
>>        
>>        
>>        
>> 
>>
>> This creates an "Edit" button in each row for every object I iterate
>> over, and I hoped to use the s:hidden tag to populate the underlying
>> UpdateEntryForm action. I also try to test it by printing from the
>> execute method as listed below, but the console output is just the
>> literal for the mark and zero for the primitive:
>>
>> This id is: 0
>> This name is: #attr.thisEntry.mark
>>
>> My action class:
>>
>> public class UpdateEntryForm extends ActionSupport{
>> public String execute(){
>>                System.out.println("This id is: "+ getId());
>>                System.out.println("This name is: "+ getMark());
>>                return SUCCESS;
>>        }
>> private String name;
>> private long mark;
>> public String getName() {
>>                return name;
>>        }
>>        public void setName(String name){
>>                this.name = name;
>>        }
>>
>>        public String getMark() {
>>                return mark;
>>        }
>>        public void setMark(String mark){
>>                this.mark = mark;
>>        }
>> }
>>
>> Is there something wrong with the code above? Thanks again!
>>
>> On Mon, Jul 13, 2009 at 2:03 PM, Musachy Barroso wrote:
>>> The current row used by displaytag is pushed under the name set in
>>> uid, so you could do this:
>>>
>>> 
>>> 
>>> 
>>> 
>>>  
>>> ">Remove
>>> 
>>>
>>> musachy
>>>
>>> On Mon, Jul 13, 2009 at 11:17 AM, Dimitrios
>>> Christodoulakis wrote:
 Thanks. So, if I wanted to access a particular property (say this
 property is called mark) of an "entry" object which I am iterating
 over, I would do something like the following:

 
 
 >>> defaultorder="ascending" title="TimeStamp"/>
 
 
 
 
 
 
   
 ">Remove
 

 So, I could pass mark as a url param via s:url within the display tag?

 Thanks for the information!

 On Mon, Jul 13, 2009 at 1:08 PM, Musachy Barroso wrote:
> Assuming that each entry is named "entry" by displayTag, you can
> access it using "#attr.entry" (or "#attr['entry']")  to access it from
> the S2 tags.
>
> musachy
>
> On Mon, Jul 13, 2009 at 10:27 AM, Dimitrios
> Christodoulakis wrote:
>> Yes, that is exactly the case, hmm.. Although, how is the
>> display:table tag finds the collection in the first place?
>>
>> Supposedly the display has some way of reaching the valuestack, it can
>> even resolve the deeper notation > name="goalToAchieve.entries"
>>
>> However, I will switch back to s:iterator to test if the syntax
>> suggested will work. I mainly used the display tag as a quick way to
>> sort the collection, but if I can't access the properties of the
>> objects I am iterating over, it isn't of much use in this case
>>
>> On Mon, Jul 13, 2009 at 12:20 PM, Greg Lindholm 
>> wrote:
>>> OK, I see the problem now...  you are not using  to go thru 
>>> the
>>> entries, you are using .
>>>
>>> The syntax suggested will not work since  does not know
>>> anything about the value stack.The >> />
>>> uses the value stack to resolve 'mark' which will not work here, you 
>>> will
>>> need to replace %{mark} with the right syntax to work with 
>>> 
>>> iterator.
>>>
>>> And I don't know anything about  so you will need to 
>>> look up
>>> how to access the properties of the entities you are iterating over so 
>>> as to
>>> build the URL.
>>>
>>>
>>> On Mon, Jul 13, 2009 at 12:28 PM, Dimitrios Christodoulakis <
>>> dimi@gmail.com> wrote:
>>>
 I made the changes, but the view source indicates that the param
 "mark" is not passed.

 The url linked is formed like this:

 /secure/DeleteEntryForm.action?name=firstName+lastName&id=1

 The name and id params are fields of the parent object, the one
 containing t

Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Musachy Barroso
you can sue that notation anywhere. A tip that will save you a lot of
time, always wrap the OGNl expressions with %{}, that's why the first
hidden is not getting evaluated. The second one has an empty value
because "goalToAchieve" is probably not pointing to anything.

btw what #attr does is search for a value in all scopes (page,
request, session , application)

musahcy

On Mon, Jul 13, 2009 at 5:57 PM, Dimitrios
Christodoulakis wrote:
> Thanks again for helping out Musachy,
> I was wondering if there are any rules regarding when the notation you
> suggested below can be used. it works perfectly for setting url
> params.
>
> I was trying to use it (with struts2 tags) within a form (which is
> within the display:column tag) to pass the value to an action:
>
> 
>        
>        
>        
>        
>        
> 
>
> This creates an "Edit" button in each row for every object I iterate
> over, and I hoped to use the s:hidden tag to populate the underlying
> UpdateEntryForm action. I also try to test it by printing from the
> execute method as listed below, but the console output is just the
> literal for the mark and zero for the primitive:
>
> This id is: 0
> This name is: #attr.thisEntry.mark
>
> My action class:
>
> public class UpdateEntryForm extends ActionSupport{
> public String execute(){
>                System.out.println("This id is: "+ getId());
>                System.out.println("This name is: "+ getMark());
>                return SUCCESS;
>        }
> private String name;
> private long mark;
> public String getName() {
>                return name;
>        }
>        public void setName(String name){
>                this.name = name;
>        }
>
>        public String getMark() {
>                return mark;
>        }
>        public void setMark(String mark){
>                this.mark = mark;
>        }
> }
>
> Is there something wrong with the code above? Thanks again!
>
> On Mon, Jul 13, 2009 at 2:03 PM, Musachy Barroso wrote:
>> The current row used by displaytag is pushed under the name set in
>> uid, so you could do this:
>>
>> 
>> 
>> 
>> 
>>  
>> ">Remove
>> 
>>
>> musachy
>>
>> On Mon, Jul 13, 2009 at 11:17 AM, Dimitrios
>> Christodoulakis wrote:
>>> Thanks. So, if I wanted to access a particular property (say this
>>> property is called mark) of an "entry" object which I am iterating
>>> over, I would do something like the following:
>>>
>>> 
>>> 
>>> >> defaultorder="ascending" title="TimeStamp"/>
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>   
>>> ">Remove
>>> 
>>>
>>> So, I could pass mark as a url param via s:url within the display tag?
>>>
>>> Thanks for the information!
>>>
>>> On Mon, Jul 13, 2009 at 1:08 PM, Musachy Barroso wrote:
 Assuming that each entry is named "entry" by displayTag, you can
 access it using "#attr.entry" (or "#attr['entry']")  to access it from
 the S2 tags.

 musachy

 On Mon, Jul 13, 2009 at 10:27 AM, Dimitrios
 Christodoulakis wrote:
> Yes, that is exactly the case, hmm.. Although, how is the
> display:table tag finds the collection in the first place?
>
> Supposedly the display has some way of reaching the valuestack, it can
> even resolve the deeper notation  name="goalToAchieve.entries"
>
> However, I will switch back to s:iterator to test if the syntax
> suggested will work. I mainly used the display tag as a quick way to
> sort the collection, but if I can't access the properties of the
> objects I am iterating over, it isn't of much use in this case
>
> On Mon, Jul 13, 2009 at 12:20 PM, Greg Lindholm 
> wrote:
>> OK, I see the problem now...  you are not using  to go thru 
>> the
>> entries, you are using .
>>
>> The syntax suggested will not work since  does not know
>> anything about the value stack.The > />
>> uses the value stack to resolve 'mark' which will not work here, you will
>> need to replace %{mark} with the right syntax to work with 
>> 
>> iterator.
>>
>> And I don't know anything about  so you will need to look 
>> up
>> how to access the properties of the entities you are iterating over so 
>> as to
>> build the URL.
>>
>>
>> On Mon, Jul 13, 2009 at 12:28 PM, Dimitrios Christodoulakis <
>> dimi@gmail.com> wrote:
>>
>>> I made the changes, but the view source indicates that the param
>>> "mark" is not passed.
>>>
>>> The url linked is formed like this:
>>>
>>> /secure/DeleteEntryForm.action?name=firstName+lastName&id=1
>>>
>>> The name and id params are fields of the parent object, the one
>>> containing the collection.
>>>
>>> Actually, I tried with all fields taken from the collection object,
>>> like entry, and date but none gets passed as a param. Only properties
>>> exposed by the parent object, goalToAchieve are passed, shouldn't I be
>>> able to point to a field within a collection object too?

Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Dimitrios Christodoulakis
Thanks again for helping out Musachy,
I was wondering if there are any rules regarding when the notation you
suggested below can be used. it works perfectly for setting url
params.

I was trying to use it (with struts2 tags) within a form (which is
within the display:column tag) to pass the value to an action:









This creates an "Edit" button in each row for every object I iterate
over, and I hoped to use the s:hidden tag to populate the underlying
UpdateEntryForm action. I also try to test it by printing from the
execute method as listed below, but the console output is just the
literal for the mark and zero for the primitive:

This id is: 0
This name is: #attr.thisEntry.mark

My action class:

public class UpdateEntryForm extends ActionSupport{
public String execute(){
System.out.println("This id is: "+ getId());
System.out.println("This name is: "+ getMark());
return SUCCESS; 
}
private String name;
private long mark;
public String getName() {
return name;
}
public void setName(String name){
this.name = name;
}

public String getMark() {
return mark;
}
public void setMark(String mark){
this.mark = mark;
}
}

Is there something wrong with the code above? Thanks again!

On Mon, Jul 13, 2009 at 2:03 PM, Musachy Barroso wrote:
> The current row used by displaytag is pushed under the name set in
> uid, so you could do this:
>
> 
> 
> 
> 
>  
> ">Remove
> 
>
> musachy
>
> On Mon, Jul 13, 2009 at 11:17 AM, Dimitrios
> Christodoulakis wrote:
>> Thanks. So, if I wanted to access a particular property (say this
>> property is called mark) of an "entry" object which I am iterating
>> over, I would do something like the following:
>>
>> 
>> 
>> > defaultorder="ascending" title="TimeStamp"/>
>> 
>> 
>> 
>> 
>> 
>> 
>>   
>> ">Remove
>> 
>>
>> So, I could pass mark as a url param via s:url within the display tag?
>>
>> Thanks for the information!
>>
>> On Mon, Jul 13, 2009 at 1:08 PM, Musachy Barroso wrote:
>>> Assuming that each entry is named "entry" by displayTag, you can
>>> access it using "#attr.entry" (or "#attr['entry']")  to access it from
>>> the S2 tags.
>>>
>>> musachy
>>>
>>> On Mon, Jul 13, 2009 at 10:27 AM, Dimitrios
>>> Christodoulakis wrote:
 Yes, that is exactly the case, hmm.. Although, how is the
 display:table tag finds the collection in the first place?

 Supposedly the display has some way of reaching the valuestack, it can
 even resolve the deeper notation >>> name="goalToAchieve.entries"

 However, I will switch back to s:iterator to test if the syntax
 suggested will work. I mainly used the display tag as a quick way to
 sort the collection, but if I can't access the properties of the
 objects I am iterating over, it isn't of much use in this case

 On Mon, Jul 13, 2009 at 12:20 PM, Greg Lindholm 
 wrote:
> OK, I see the problem now...  you are not using  to go thru 
> the
> entries, you are using .
>
> The syntax suggested will not work since  does not know
> anything about the value stack.The 
> uses the value stack to resolve 'mark' which will not work here, you will
> need to replace %{mark} with the right syntax to work with 
> iterator.
>
> And I don't know anything about  so you will need to look 
> up
> how to access the properties of the entities you are iterating over so as 
> to
> build the URL.
>
>
> On Mon, Jul 13, 2009 at 12:28 PM, Dimitrios Christodoulakis <
> dimi@gmail.com> wrote:
>
>> I made the changes, but the view source indicates that the param
>> "mark" is not passed.
>>
>> The url linked is formed like this:
>>
>> /secure/DeleteEntryForm.action?name=firstName+lastName&id=1
>>
>> The name and id params are fields of the parent object, the one
>> containing the collection.
>>
>> Actually, I tried with all fields taken from the collection object,
>> like entry, and date but none gets passed as a param. Only properties
>> exposed by the parent object, goalToAchieve are passed, shouldn't I be
>> able to point to a field within a collection object too?
>>
>> It looks like individual collection object properties can be viewed
>> using the iterator/display, but cannot be "captured" or passed as
>> parameters for any other uses... unless I am missing something, or
>> doing something wrong.
>>
>>
>> On Mon, Jul 13, 2009 at 10:50 AM, Greg Lindholm
>> wrote:
>> > Looks like you need to change entry.mark to just mark and remove the
>> > . Also you probably don't need to pass 
>> > both
>> > the name and id of the parent object.
>> >
>> > 
>> >       
>> >       
>> >   
>> > ">Remove

Re: MethodFilterInterceptor

2009-07-13 Thread Musachy Barroso
> independent of the methods' package name

I am not sure what you mean by this. example?

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

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



Re: [Struts 2.1] Using a s:select with type conversion

2009-07-13 Thread Musachy Barroso
I don't think you can rely on the select tag for a list of dates, as
it (obviously :)) doesn't know how to convert the dates to string.
What I find strange is that looking at the freemarker code it seems to
be like both the value and the caption should be the same
(toString()):

<@s.iterator value="parameters.list">
<#if parameters.listKey??>
<#if stack.findValue(parameters.listKey)??>
  <#assign itemKey = stack.findValue(parameters.listKey)/>
  <#assign itemKeyStr = stack.findString(parameters.listKey)/>
<#else>
  <#assign itemKey = ''/>
  <#assign itemKeyStr = ''/>

<#else>
<#assign itemKey = stack.findValue('top')/>
<#assign itemKeyStr = stack.findString('top')>

<#if parameters.listValue??>
<#if stack.findString(parameters.listValue)??>
  <#assign itemValue = stack.findString(parameters.listValue)/>
<#else>
  <#assign itemValue = ''/>

<#else>
<#assign itemValue = stack.findString('top')/>


<#if tag.contains(parameters.nameValue, itemKey) == true>
 selected="selected"<#rt/>

>${itemValue?html}<#lt/>


btw I just realized that you can put put a method call on the
"listKey" and "listValue", like



I haven't tried tho.
musachy

On Mon, Jul 13, 2009 at 12:23 PM, dcabasson wrote:
>
> Hi, I have trouble understanding the way TypeConversion along a s:select tag.
>
> Any advice on the matter would be welcomed.
>
> I have posted the bug under https://issues.apache.org/struts/browse/WW-3184
> attaching a simple Use Case showing what I find to be an unexpected
> behaviour.
>
> Thanks for your help!
> Denis.
> --
> View this message in context: 
> http://www.nabble.com/-Struts-2.1--Using-a-s%3Aselect-with-type-conversion-tp24467738p24467738.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
>
>



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

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



Re: Uploading large files

2009-07-13 Thread Wes Wannemacher
On Mon, Jul 13, 2009 at 4:34 PM, Dale Newfield wrote:
>
>> I remember once I came across another possible solution, which allows the
>> serialization of the file data as it is received from the server.
>
> I assume that the multipart request processor streams the content into a
> file without first loading the entire thing into memory...if you know that
> this is not the case, please point out the offending portion of code...
>
> -Dale
>

I am pretty sure you are right Dale, there was a JIRA that the choice
was unavailable. The GAE doesn't allow you to write files anywhere on
the filesystem, and there was no option to configure this behavior.
That's one of the reasons I started a plugin. The choices are
available in commons-fileupload, but we just weren't exposing them.
I'm guessing the files are getting serialized (I think the threshold
is way less than what he is talking about), he just didn't see them
anywhere.

-Wes
-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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



Re: Uploading large files

2009-07-13 Thread Dale Newfield

Daniele Development-ML wrote:

I am developing a web application that needs to allow uploading of file of
sizes ranging 200Mb - 1 GB.


My current app allows for files up to 1GB.


Currently, I'm doing this with the FileUploadAction, which however
loads the entire file in memory - as I understood


There's a class with that name in the showcase, but that's not part of 
the API.  Is this a custom built class you're referring to?  What makes 
you think it loads the entire file into memory?



I remember once I came across another possible solution, which allows the
serialization of the file data as it is received from the server.


I assume that the multipart request processor streams the content into a 
file without first loading the entire thing into memory...if you know 
that this is not the case, please point out the offending portion of code...


-Dale

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



Re: For s:textfield tag how to get value for title attribute from resource bundle.

2009-07-13 Thread Dave Newton

wkbutler wrote:

Bottom line was that the resource props need to be packaged in the
same package as the action class, with the same name.


getText calls will follow the hierarchy noted in the docs:

http://struts.apache.org/2.1.6/docs/localization.html

Dave

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



[Struts 2.1] Using a s:select with type conversion

2009-07-13 Thread dcabasson

Hi, I have trouble understanding the way TypeConversion along a s:select tag.

Any advice on the matter would be welcomed.

I have posted the bug under https://issues.apache.org/struts/browse/WW-3184
attaching a simple Use Case showing what I find to be an unexpected
behaviour.

Thanks for your help!
Denis.
-- 
View this message in context: 
http://www.nabble.com/-Struts-2.1--Using-a-s%3Aselect-with-type-conversion-tp24467738p24467738.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: updating or deleting a component from a collection through display tag

2009-07-13 Thread Dimitrios Christodoulakis
Hey, this worked! Thanks Musachy, the tip you provided solved the
problem I was facing for the last 3 days.

I really appreciate your time to post this information. It looks like
the display tag packs much more functionality than it seems.

On Mon, Jul 13, 2009 at 2:03 PM, Musachy Barroso wrote:
> The current row used by displaytag is pushed under the name set in
> uid, so you could do this:
>
> 
> 
> 
> 
>  
> ">Remove
> 
>
> musachy
>
> On Mon, Jul 13, 2009 at 11:17 AM, Dimitrios
> Christodoulakis wrote:
>> Thanks. So, if I wanted to access a particular property (say this
>> property is called mark) of an "entry" object which I am iterating
>> over, I would do something like the following:
>>
>> 
>> 
>> > defaultorder="ascending" title="TimeStamp"/>
>> 
>> 
>> 
>> 
>> 
>> 
>>   
>> ">Remove
>> 
>>
>> So, I could pass mark as a url param via s:url within the display tag?
>>
>> Thanks for the information!
>>
>> On Mon, Jul 13, 2009 at 1:08 PM, Musachy Barroso wrote:
>>> Assuming that each entry is named "entry" by displayTag, you can
>>> access it using "#attr.entry" (or "#attr['entry']")  to access it from
>>> the S2 tags.
>>>
>>> musachy
>>>
>>> On Mon, Jul 13, 2009 at 10:27 AM, Dimitrios
>>> Christodoulakis wrote:
 Yes, that is exactly the case, hmm.. Although, how is the
 display:table tag finds the collection in the first place?

 Supposedly the display has some way of reaching the valuestack, it can
 even resolve the deeper notation >>> name="goalToAchieve.entries"

 However, I will switch back to s:iterator to test if the syntax
 suggested will work. I mainly used the display tag as a quick way to
 sort the collection, but if I can't access the properties of the
 objects I am iterating over, it isn't of much use in this case

 On Mon, Jul 13, 2009 at 12:20 PM, Greg Lindholm 
 wrote:
> OK, I see the problem now...  you are not using  to go thru 
> the
> entries, you are using .
>
> The syntax suggested will not work since  does not know
> anything about the value stack.The 
> uses the value stack to resolve 'mark' which will not work here, you will
> need to replace %{mark} with the right syntax to work with 
> iterator.
>
> And I don't know anything about  so you will need to look 
> up
> how to access the properties of the entities you are iterating over so as 
> to
> build the URL.
>
>
> On Mon, Jul 13, 2009 at 12:28 PM, Dimitrios Christodoulakis <
> dimi@gmail.com> wrote:
>
>> I made the changes, but the view source indicates that the param
>> "mark" is not passed.
>>
>> The url linked is formed like this:
>>
>> /secure/DeleteEntryForm.action?name=firstName+lastName&id=1
>>
>> The name and id params are fields of the parent object, the one
>> containing the collection.
>>
>> Actually, I tried with all fields taken from the collection object,
>> like entry, and date but none gets passed as a param. Only properties
>> exposed by the parent object, goalToAchieve are passed, shouldn't I be
>> able to point to a field within a collection object too?
>>
>> It looks like individual collection object properties can be viewed
>> using the iterator/display, but cannot be "captured" or passed as
>> parameters for any other uses... unless I am missing something, or
>> doing something wrong.
>>
>>
>> On Mon, Jul 13, 2009 at 10:50 AM, Greg Lindholm
>> wrote:
>> > Looks like you need to change entry.mark to just mark and remove the
>> > . Also you probably don't need to pass 
>> > both
>> > the name and id of the parent object.
>> >
>> > 
>> >       
>> >       
>> >   
>> > ">Remove
>> >
>> >
>> > On Mon, Jul 13, 2009 at 10:48 AM, Dimitrios Christodoulakis <
>> > dimi@gmail.com> wrote:
>> >
>> >> Thanks for letting me know. Alright, so:
>> >>
>> >> This is the parent class:
>> >>
>> >> @Entity
>> >> public class GoalToAchieve {
>> >> @Id @GeneratedValue
>> >> private Long id;
>> >>
>> >> @org.hibernate.annotations.CollectionOfElements
>> >> @JoinTable (name="GoalToAchieve_entry",
>> >> joincolum...@joincolumn(name="goalToAchieve_id"))
>> >> private Set entries = new HashSet();
>> >>
>> >>        public Set getEntries() {
>> >>                return entries;
>> >>        }
>> >>        public void setEntries(SortedSet entries) {
>> >>                this.entries = entries;
>> >>        }
>> >>
>> >>        public void addEntry(JournalEntry newEntry){
>> >>                entries.add(newEntry);
>> >>        }
>> >>
>> >>        public void deleteEntry(JournalEntry entry){
>> >>                entries.remove(entry);
>> >>        }
>> >> ..plus some other standard fields with getters and setters
>> >>
>> >

Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Musachy Barroso
The current row used by displaytag is pushed under the name set in
uid, so you could do this:





  
">Remove


musachy

On Mon, Jul 13, 2009 at 11:17 AM, Dimitrios
Christodoulakis wrote:
> Thanks. So, if I wanted to access a particular property (say this
> property is called mark) of an "entry" object which I am iterating
> over, I would do something like the following:
>
> 
> 
>  defaultorder="ascending" title="TimeStamp"/>
> 
> 
> 
> 
> 
> 
>   
> ">Remove
> 
>
> So, I could pass mark as a url param via s:url within the display tag?
>
> Thanks for the information!
>
> On Mon, Jul 13, 2009 at 1:08 PM, Musachy Barroso wrote:
>> Assuming that each entry is named "entry" by displayTag, you can
>> access it using "#attr.entry" (or "#attr['entry']")  to access it from
>> the S2 tags.
>>
>> musachy
>>
>> On Mon, Jul 13, 2009 at 10:27 AM, Dimitrios
>> Christodoulakis wrote:
>>> Yes, that is exactly the case, hmm.. Although, how is the
>>> display:table tag finds the collection in the first place?
>>>
>>> Supposedly the display has some way of reaching the valuestack, it can
>>> even resolve the deeper notation >> name="goalToAchieve.entries"
>>>
>>> However, I will switch back to s:iterator to test if the syntax
>>> suggested will work. I mainly used the display tag as a quick way to
>>> sort the collection, but if I can't access the properties of the
>>> objects I am iterating over, it isn't of much use in this case
>>>
>>> On Mon, Jul 13, 2009 at 12:20 PM, Greg Lindholm 
>>> wrote:
 OK, I see the problem now...  you are not using  to go thru the
 entries, you are using .

 The syntax suggested will not work since  does not know
 anything about the value stack.The 
 uses the value stack to resolve 'mark' which will not work here, you will
 need to replace %{mark} with the right syntax to work with 
 iterator.

 And I don't know anything about  so you will need to look up
 how to access the properties of the entities you are iterating over so as 
 to
 build the URL.


 On Mon, Jul 13, 2009 at 12:28 PM, Dimitrios Christodoulakis <
 dimi@gmail.com> wrote:

> I made the changes, but the view source indicates that the param
> "mark" is not passed.
>
> The url linked is formed like this:
>
> /secure/DeleteEntryForm.action?name=firstName+lastName&id=1
>
> The name and id params are fields of the parent object, the one
> containing the collection.
>
> Actually, I tried with all fields taken from the collection object,
> like entry, and date but none gets passed as a param. Only properties
> exposed by the parent object, goalToAchieve are passed, shouldn't I be
> able to point to a field within a collection object too?
>
> It looks like individual collection object properties can be viewed
> using the iterator/display, but cannot be "captured" or passed as
> parameters for any other uses... unless I am missing something, or
> doing something wrong.
>
>
> On Mon, Jul 13, 2009 at 10:50 AM, Greg Lindholm
> wrote:
> > Looks like you need to change entry.mark to just mark and remove the
> > . Also you probably don't need to pass 
> > both
> > the name and id of the parent object.
> >
> > 
> >       
> >       
> >   
> > ">Remove
> >
> >
> > On Mon, Jul 13, 2009 at 10:48 AM, Dimitrios Christodoulakis <
> > dimi@gmail.com> wrote:
> >
> >> Thanks for letting me know. Alright, so:
> >>
> >> This is the parent class:
> >>
> >> @Entity
> >> public class GoalToAchieve {
> >> @Id @GeneratedValue
> >> private Long id;
> >>
> >> @org.hibernate.annotations.CollectionOfElements
> >> @JoinTable (name="GoalToAchieve_entry",
> >> joincolum...@joincolumn(name="goalToAchieve_id"))
> >> private Set entries = new HashSet();
> >>
> >>        public Set getEntries() {
> >>                return entries;
> >>        }
> >>        public void setEntries(SortedSet entries) {
> >>                this.entries = entries;
> >>        }
> >>
> >>        public void addEntry(JournalEntry newEntry){
> >>                entries.add(newEntry);
> >>        }
> >>
> >>        public void deleteEntry(JournalEntry entry){
> >>                entries.remove(entry);
> >>        }
> >> ..plus some other standard fields with getters and setters
> >>
> >> This is the child-class:
> >>
> >> @Embeddable
> >> public class JournalEntry {
> >> @org.hibernate.annotations.Parent
> >> private GoalToAchieve goalToAchieve;
> >>
> >> @Column
> >> private Long mark;
> >> public Long getMark() {
> >>        return mark;
> >> }
> >> public void setMark(long mark){
> >>        this.mark = mark;
> >>         }
> >>
> >> @Column(length = 255, nullable = false)
> >

Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Dimitrios Christodoulakis
Thanks. So, if I wanted to access a particular property (say this
property is called mark) of an "entry" object which I am iterating
over, I would do something like the following:










   
">Remove


So, I could pass mark as a url param via s:url within the display tag?

Thanks for the information!

On Mon, Jul 13, 2009 at 1:08 PM, Musachy Barroso wrote:
> Assuming that each entry is named "entry" by displayTag, you can
> access it using "#attr.entry" (or "#attr['entry']")  to access it from
> the S2 tags.
>
> musachy
>
> On Mon, Jul 13, 2009 at 10:27 AM, Dimitrios
> Christodoulakis wrote:
>> Yes, that is exactly the case, hmm.. Although, how is the
>> display:table tag finds the collection in the first place?
>>
>> Supposedly the display has some way of reaching the valuestack, it can
>> even resolve the deeper notation > name="goalToAchieve.entries"
>>
>> However, I will switch back to s:iterator to test if the syntax
>> suggested will work. I mainly used the display tag as a quick way to
>> sort the collection, but if I can't access the properties of the
>> objects I am iterating over, it isn't of much use in this case
>>
>> On Mon, Jul 13, 2009 at 12:20 PM, Greg Lindholm 
>> wrote:
>>> OK, I see the problem now...  you are not using  to go thru the
>>> entries, you are using .
>>>
>>> The syntax suggested will not work since  does not know
>>> anything about the value stack.The 
>>> uses the value stack to resolve 'mark' which will not work here, you will
>>> need to replace %{mark} with the right syntax to work with 
>>> iterator.
>>>
>>> And I don't know anything about  so you will need to look up
>>> how to access the properties of the entities you are iterating over so as to
>>> build the URL.
>>>
>>>
>>> On Mon, Jul 13, 2009 at 12:28 PM, Dimitrios Christodoulakis <
>>> dimi@gmail.com> wrote:
>>>
 I made the changes, but the view source indicates that the param
 "mark" is not passed.

 The url linked is formed like this:

 /secure/DeleteEntryForm.action?name=firstName+lastName&id=1

 The name and id params are fields of the parent object, the one
 containing the collection.

 Actually, I tried with all fields taken from the collection object,
 like entry, and date but none gets passed as a param. Only properties
 exposed by the parent object, goalToAchieve are passed, shouldn't I be
 able to point to a field within a collection object too?

 It looks like individual collection object properties can be viewed
 using the iterator/display, but cannot be "captured" or passed as
 parameters for any other uses... unless I am missing something, or
 doing something wrong.


 On Mon, Jul 13, 2009 at 10:50 AM, Greg Lindholm
 wrote:
 > Looks like you need to change entry.mark to just mark and remove the
 > . Also you probably don't need to pass both
 > the name and id of the parent object.
 >
 > 
 >       
 >       
 >   
 > ">Remove
 >
 >
 > On Mon, Jul 13, 2009 at 10:48 AM, Dimitrios Christodoulakis <
 > dimi@gmail.com> wrote:
 >
 >> Thanks for letting me know. Alright, so:
 >>
 >> This is the parent class:
 >>
 >> @Entity
 >> public class GoalToAchieve {
 >> @Id @GeneratedValue
 >> private Long id;
 >>
 >> @org.hibernate.annotations.CollectionOfElements
 >> @JoinTable (name="GoalToAchieve_entry",
 >> joincolum...@joincolumn(name="goalToAchieve_id"))
 >> private Set entries = new HashSet();
 >>
 >>        public Set getEntries() {
 >>                return entries;
 >>        }
 >>        public void setEntries(SortedSet entries) {
 >>                this.entries = entries;
 >>        }
 >>
 >>        public void addEntry(JournalEntry newEntry){
 >>                entries.add(newEntry);
 >>        }
 >>
 >>        public void deleteEntry(JournalEntry entry){
 >>                entries.remove(entry);
 >>        }
 >> ..plus some other standard fields with getters and setters
 >>
 >> This is the child-class:
 >>
 >> @Embeddable
 >> public class JournalEntry {
 >> @org.hibernate.annotations.Parent
 >> private GoalToAchieve goalToAchieve;
 >>
 >> @Column
 >> private Long mark;
 >> public Long getMark() {
 >>        return mark;
 >> }
 >> public void setMark(long mark){
 >>        this.mark = mark;
 >>         }
 >>
 >> @Column(length = 255, nullable = false)
 >> private String entry;
 >>
 >> @Temporal(TemporalType.TIMESTAMP)
 >> @Column(nullable = false, updatable = false)
 >> private Date insertDate = new Date();
 >>
 >> ..plus the rest getters and setters
 >>
 >> And this this the jsp part where I display the collection:
 >>
 >> 
>>>

Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Musachy Barroso
Assuming that each entry is named "entry" by displayTag, you can
access it using "#attr.entry" (or "#attr['entry']")  to access it from
the S2 tags.

musachy

On Mon, Jul 13, 2009 at 10:27 AM, Dimitrios
Christodoulakis wrote:
> Yes, that is exactly the case, hmm.. Although, how is the
> display:table tag finds the collection in the first place?
>
> Supposedly the display has some way of reaching the valuestack, it can
> even resolve the deeper notation  name="goalToAchieve.entries"
>
> However, I will switch back to s:iterator to test if the syntax
> suggested will work. I mainly used the display tag as a quick way to
> sort the collection, but if I can't access the properties of the
> objects I am iterating over, it isn't of much use in this case
>
> On Mon, Jul 13, 2009 at 12:20 PM, Greg Lindholm 
> wrote:
>> OK, I see the problem now...  you are not using  to go thru the
>> entries, you are using .
>>
>> The syntax suggested will not work since  does not know
>> anything about the value stack.The 
>> uses the value stack to resolve 'mark' which will not work here, you will
>> need to replace %{mark} with the right syntax to work with 
>> iterator.
>>
>> And I don't know anything about  so you will need to look up
>> how to access the properties of the entities you are iterating over so as to
>> build the URL.
>>
>>
>> On Mon, Jul 13, 2009 at 12:28 PM, Dimitrios Christodoulakis <
>> dimi@gmail.com> wrote:
>>
>>> I made the changes, but the view source indicates that the param
>>> "mark" is not passed.
>>>
>>> The url linked is formed like this:
>>>
>>> /secure/DeleteEntryForm.action?name=firstName+lastName&id=1
>>>
>>> The name and id params are fields of the parent object, the one
>>> containing the collection.
>>>
>>> Actually, I tried with all fields taken from the collection object,
>>> like entry, and date but none gets passed as a param. Only properties
>>> exposed by the parent object, goalToAchieve are passed, shouldn't I be
>>> able to point to a field within a collection object too?
>>>
>>> It looks like individual collection object properties can be viewed
>>> using the iterator/display, but cannot be "captured" or passed as
>>> parameters for any other uses... unless I am missing something, or
>>> doing something wrong.
>>>
>>>
>>> On Mon, Jul 13, 2009 at 10:50 AM, Greg Lindholm
>>> wrote:
>>> > Looks like you need to change entry.mark to just mark and remove the
>>> > . Also you probably don't need to pass both
>>> > the name and id of the parent object.
>>> >
>>> > 
>>> >       
>>> >       
>>> >   
>>> > ">Remove
>>> >
>>> >
>>> > On Mon, Jul 13, 2009 at 10:48 AM, Dimitrios Christodoulakis <
>>> > dimi@gmail.com> wrote:
>>> >
>>> >> Thanks for letting me know. Alright, so:
>>> >>
>>> >> This is the parent class:
>>> >>
>>> >> @Entity
>>> >> public class GoalToAchieve {
>>> >> @Id @GeneratedValue
>>> >> private Long id;
>>> >>
>>> >> @org.hibernate.annotations.CollectionOfElements
>>> >> @JoinTable (name="GoalToAchieve_entry",
>>> >> joincolum...@joincolumn(name="goalToAchieve_id"))
>>> >> private Set entries = new HashSet();
>>> >>
>>> >>        public Set getEntries() {
>>> >>                return entries;
>>> >>        }
>>> >>        public void setEntries(SortedSet entries) {
>>> >>                this.entries = entries;
>>> >>        }
>>> >>
>>> >>        public void addEntry(JournalEntry newEntry){
>>> >>                entries.add(newEntry);
>>> >>        }
>>> >>
>>> >>        public void deleteEntry(JournalEntry entry){
>>> >>                entries.remove(entry);
>>> >>        }
>>> >> ..plus some other standard fields with getters and setters
>>> >>
>>> >> This is the child-class:
>>> >>
>>> >> @Embeddable
>>> >> public class JournalEntry {
>>> >> @org.hibernate.annotations.Parent
>>> >> private GoalToAchieve goalToAchieve;
>>> >>
>>> >> @Column
>>> >> private Long mark;
>>> >> public Long getMark() {
>>> >>        return mark;
>>> >> }
>>> >> public void setMark(long mark){
>>> >>        this.mark = mark;
>>> >>         }
>>> >>
>>> >> @Column(length = 255, nullable = false)
>>> >> private String entry;
>>> >>
>>> >> @Temporal(TemporalType.TIMESTAMP)
>>> >> @Column(nullable = false, updatable = false)
>>> >> private Date insertDate = new Date();
>>> >>
>>> >> ..plus the rest getters and setters
>>> >>
>>> >> And this this the jsp part where I display the collection:
>>> >>
>>> >> 
>>> >> >> uid="thisGoal">
>>> >>        
>>> >>        >> >> defaultorder="ascending" title="TimeStamp"/>
>>> >>        
>>> >>  
>>> >> 
>>> >>        
>>> >>    
>>> >>    ">Edit
>>> >> 
>>> >> 
>>> >> 
>>> >>         
>>> >>         
>>> >>        
>>> >>        
>>> >>    
>>> >> ">Remove
>>> >> 
>>> >> 
>>> >> 
>>> >>
>>> >> ..and the delete action, which should take an entry reference and
>>> >> remove it from the collections looks like this:
>>> >>
>>> >> public class DeleteEntry extends ActionSupport{
>>> >> public String execute(){
>>> >>                goalToAchieve.deleteEntry(en

RE: For s:textfield tag how to get value for title attribute from resource bundle.

2009-07-13 Thread wkbutler

OK - I got getText() working via checking out the code in
com.opensymphony.xwork.util.LocalizedTextUtil , and the StrutsInAction book
has a pretty good section this.  Bottom line was that the resource props
need to be packaged in the same package as the action class, with the same
name.  I preferred another solution however, which was to declare a marker
interface and use the same trick on that (declare props file with same name,
same packaging), and any class implementing that inherits access to that
bundle.

Anyway, my followup question -  I can't use the 'key' attribute on this tag:




How would you submit a variable as the identifier for the i18n key in the
above?  This syntax produces the result for the key  "question.questionKey".  
It is supposed to be evaluating the value of variable 
  formQuestion.question.questionKey

via OGNL object access as finding the value  "q.client.firstName"  etc.

Any idea how to specify that the inner OGNL translation should happen first?  
I have tried 
label="getText('%{formQuestion.question.questionKey}')" 

among many others.  Haven't found this on the forums, probably missed it
though.  Thanks -






wkbutler wrote:
> 
> Is this still the only way to get i18n translatations into a struts tag
> from the resource bundle?
> 
> I'm trying to get a label on some struts fields, i.e.
> 
> 
> name="userResponses[%{#loop.index}].userResponseValues[0].value" 
> label="%{getText('q.client.name.first')}" 
> value="%{userResponseValues[0].value}" 
> required="%{formQuestion.required}" 
> maxlength="%{formQuestion.maxLength}" 
> cssStyle="width:%{fieldSize}px" 
> cssClass="text medium"/>
> 
> with a messageSource defined as
> 
>class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
>
>  
>  classpath:/form
>
> 
>   
>   
> 
> I've never seen the getText() work successfully, but the following do
> work:
> 
> 
> 
> 
> 
> 
> 
> 
> I also have the JSTL message source defined in web.xml still, but removing
> that doesn't help the getText succeed.
> 
> Any ideas on getting getText() to work?  Or alternatives ways of getting
> an i18n label on the s:textfield?  Thanks for any ideas -
> 
> 
> 
> 
> LEONARD Julien (Consulting for ACCOR Hotels) wrote:
>> 
>> Try this :
>> 
>> > cssClass="fieldGreen validate-alpha " value=""
>> title="%{getText('category.categoryName')}" id="categoryName"/> 
>> 
>> http://struts.apache.org/2.0.11/docs/localization.html
>> 
>> Julien
>> 
>> -Message d'origine-
>> De : VJ22 [mailto:vijay.n...@iflexsolutions.com] 
>> Envoyé : vendredi 22 février 2008 16:26
>> À : user@struts.apache.org
>> Objet : For s:textfield tag how to get value for title attribute from
>> resource bundle.
>> 
>> 
>> For s:textfield tag how to get value for title attribute from resource
>> bundle. 
>> I tried using  but seems the struts2 is  not recognising
>> this inside the title tag and considering it as plain text.
>> Please let me know if there exists a way to do the same For eg i tried 
>> > cssClass="fieldGreen validate-alpha " value="" title="> key='category.categoryName'/>" id="categoryName"/>
>> 
>> Here category.categoryName is refering to resouce bundle property.
>> 
>> --
>> View this message in context:
>> http://www.nabble.com/For-s%3Atextfield-tag-how-to-get-value-for-title-attribute-from-resource-bundle.-tp15634305p15634305.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/For-s%3Atextfield-tag-how-to-get-value-for-title-attribute-from-resource-bundle.-tp15634305p24466512.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: validwhen question

2009-07-13 Thread Paul Benedict
I believe the correct syntax is:


  test
  (*this* != null)


But why are you doing this? Such a simple validation can be
accomplished with the "required" validator.

Paul

On Mon, Jul 13, 2009 at 11:20 AM, Lukasz
Lenart wrote:
> 2009/7/13 Odelya YomTov :
>> But I don't see that it works! Why?
>
> Did you try like this?
>
> data.category != \'empty\'
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
> http://dailylog.lenart.org.pl/
>
> -
> 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: updating or deleting a component from a collection through display tag

2009-07-13 Thread Dimitrios Christodoulakis
Yes, that is exactly the case, hmm.. Although, how is the
display:table tag finds the collection in the first place?

Supposedly the display has some way of reaching the valuestack, it can
even resolve the deeper notation  wrote:
> OK, I see the problem now...  you are not using  to go thru the
> entries, you are using .
>
> The syntax suggested will not work since  does not know
> anything about the value stack.The 
> uses the value stack to resolve 'mark' which will not work here, you will
> need to replace %{mark} with the right syntax to work with 
> iterator.
>
> And I don't know anything about  so you will need to look up
> how to access the properties of the entities you are iterating over so as to
> build the URL.
>
>
> On Mon, Jul 13, 2009 at 12:28 PM, Dimitrios Christodoulakis <
> dimi@gmail.com> wrote:
>
>> I made the changes, but the view source indicates that the param
>> "mark" is not passed.
>>
>> The url linked is formed like this:
>>
>> /secure/DeleteEntryForm.action?name=firstName+lastName&id=1
>>
>> The name and id params are fields of the parent object, the one
>> containing the collection.
>>
>> Actually, I tried with all fields taken from the collection object,
>> like entry, and date but none gets passed as a param. Only properties
>> exposed by the parent object, goalToAchieve are passed, shouldn't I be
>> able to point to a field within a collection object too?
>>
>> It looks like individual collection object properties can be viewed
>> using the iterator/display, but cannot be "captured" or passed as
>> parameters for any other uses... unless I am missing something, or
>> doing something wrong.
>>
>>
>> On Mon, Jul 13, 2009 at 10:50 AM, Greg Lindholm
>> wrote:
>> > Looks like you need to change entry.mark to just mark and remove the
>> > . Also you probably don't need to pass both
>> > the name and id of the parent object.
>> >
>> > 
>> >       
>> >       
>> >   
>> > ">Remove
>> >
>> >
>> > On Mon, Jul 13, 2009 at 10:48 AM, Dimitrios Christodoulakis <
>> > dimi@gmail.com> wrote:
>> >
>> >> Thanks for letting me know. Alright, so:
>> >>
>> >> This is the parent class:
>> >>
>> >> @Entity
>> >> public class GoalToAchieve {
>> >> @Id @GeneratedValue
>> >> private Long id;
>> >>
>> >> @org.hibernate.annotations.CollectionOfElements
>> >> @JoinTable (name="GoalToAchieve_entry",
>> >> joincolum...@joincolumn(name="goalToAchieve_id"))
>> >> private Set entries = new HashSet();
>> >>
>> >>        public Set getEntries() {
>> >>                return entries;
>> >>        }
>> >>        public void setEntries(SortedSet entries) {
>> >>                this.entries = entries;
>> >>        }
>> >>
>> >>        public void addEntry(JournalEntry newEntry){
>> >>                entries.add(newEntry);
>> >>        }
>> >>
>> >>        public void deleteEntry(JournalEntry entry){
>> >>                entries.remove(entry);
>> >>        }
>> >> ..plus some other standard fields with getters and setters
>> >>
>> >> This is the child-class:
>> >>
>> >> @Embeddable
>> >> public class JournalEntry {
>> >> @org.hibernate.annotations.Parent
>> >> private GoalToAchieve goalToAchieve;
>> >>
>> >> @Column
>> >> private Long mark;
>> >> public Long getMark() {
>> >>        return mark;
>> >> }
>> >> public void setMark(long mark){
>> >>        this.mark = mark;
>> >>         }
>> >>
>> >> @Column(length = 255, nullable = false)
>> >> private String entry;
>> >>
>> >> @Temporal(TemporalType.TIMESTAMP)
>> >> @Column(nullable = false, updatable = false)
>> >> private Date insertDate = new Date();
>> >>
>> >> ..plus the rest getters and setters
>> >>
>> >> And this this the jsp part where I display the collection:
>> >>
>> >> 
>> >> > uid="thisGoal">
>> >>        
>> >>        > >> defaultorder="ascending" title="TimeStamp"/>
>> >>        
>> >>  
>> >> 
>> >>        
>> >>    
>> >>    ">Edit
>> >> 
>> >> 
>> >> 
>> >>         
>> >>         
>> >>        
>> >>        
>> >>    
>> >> ">Remove
>> >> 
>> >> 
>> >> 
>> >>
>> >> ..and the delete action, which should take an entry reference and
>> >> remove it from the collections looks like this:
>> >>
>> >> public class DeleteEntry extends ActionSupport{
>> >> public String execute(){
>> >>                goalToAchieve.deleteEntry(entry);
>> >>
>> >>                return SUCCESS;
>> >>        }
>> >>
>> >>        private JournalEntry entry;
>> >>        private GoalToAchieve goalToAchieve;
>> >>        private long id;
>> >>
>> >> ... + getters and setters
>> >>
>> >> I guess right now, my problem has become how to pass a parameter
>> >> referring to en entry (the mark field) to the delete action. Next, I
>> >> would do a lookup within the action to find the entry object and
>> >> remove it from the parent object collection, by calling
>> >> deleteEntry(JournalEntry entry)
>> >>
>> >> On Mon, Jul 13, 2009 at 9:16 AM, Greg Lindholm
>> >> wrote:
>> >> > You are not providing enough information for anyone to help you. Since
>> >> you
>> >> > have change

Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Greg Lindholm
OK, I see the problem now...  you are not using  to go thru the
entries, you are using .

The syntax suggested will not work since  does not know
anything about the value stack.The 
uses the value stack to resolve 'mark' which will not work here, you will
need to replace %{mark} with the right syntax to work with 
iterator.

And I don't know anything about  so you will need to look up
how to access the properties of the entities you are iterating over so as to
build the URL.


On Mon, Jul 13, 2009 at 12:28 PM, Dimitrios Christodoulakis <
dimi@gmail.com> wrote:

> I made the changes, but the view source indicates that the param
> "mark" is not passed.
>
> The url linked is formed like this:
>
> /secure/DeleteEntryForm.action?name=firstName+lastName&id=1
>
> The name and id params are fields of the parent object, the one
> containing the collection.
>
> Actually, I tried with all fields taken from the collection object,
> like entry, and date but none gets passed as a param. Only properties
> exposed by the parent object, goalToAchieve are passed, shouldn't I be
> able to point to a field within a collection object too?
>
> It looks like individual collection object properties can be viewed
> using the iterator/display, but cannot be "captured" or passed as
> parameters for any other uses... unless I am missing something, or
> doing something wrong.
>
>
> On Mon, Jul 13, 2009 at 10:50 AM, Greg Lindholm
> wrote:
> > Looks like you need to change entry.mark to just mark and remove the
> > . Also you probably don't need to pass both
> > the name and id of the parent object.
> >
> > 
> >   
> >   
> >   
> > ">Remove
> >
> >
> > On Mon, Jul 13, 2009 at 10:48 AM, Dimitrios Christodoulakis <
> > dimi@gmail.com> wrote:
> >
> >> Thanks for letting me know. Alright, so:
> >>
> >> This is the parent class:
> >>
> >> @Entity
> >> public class GoalToAchieve {
> >> @Id @GeneratedValue
> >> private Long id;
> >>
> >> @org.hibernate.annotations.CollectionOfElements
> >> @JoinTable (name="GoalToAchieve_entry",
> >> joincolum...@joincolumn(name="goalToAchieve_id"))
> >> private Set entries = new HashSet();
> >>
> >>public Set getEntries() {
> >>return entries;
> >>}
> >>public void setEntries(SortedSet entries) {
> >>this.entries = entries;
> >>}
> >>
> >>public void addEntry(JournalEntry newEntry){
> >>entries.add(newEntry);
> >>}
> >>
> >>public void deleteEntry(JournalEntry entry){
> >>entries.remove(entry);
> >>}
> >> ..plus some other standard fields with getters and setters
> >>
> >> This is the child-class:
> >>
> >> @Embeddable
> >> public class JournalEntry {
> >> @org.hibernate.annotations.Parent
> >> private GoalToAchieve goalToAchieve;
> >>
> >> @Column
> >> private Long mark;
> >> public Long getMark() {
> >>return mark;
> >> }
> >> public void setMark(long mark){
> >>this.mark = mark;
> >> }
> >>
> >> @Column(length = 255, nullable = false)
> >> private String entry;
> >>
> >> @Temporal(TemporalType.TIMESTAMP)
> >> @Column(nullable = false, updatable = false)
> >> private Date insertDate = new Date();
> >>
> >> ..plus the rest getters and setters
> >>
> >> And this this the jsp part where I display the collection:
> >>
> >> 
> >>  uid="thisGoal">
> >>
> >> >> defaultorder="ascending" title="TimeStamp"/>
> >>
> >>  
> >> 
> >>
> >>
> >>">Edit
> >> 
> >> 
> >> 
> >> 
> >> 
> >>
> >>
> >>
> >> ">Remove
> >> 
> >> 
> >> 
> >>
> >> ..and the delete action, which should take an entry reference and
> >> remove it from the collections looks like this:
> >>
> >> public class DeleteEntry extends ActionSupport{
> >> public String execute(){
> >>goalToAchieve.deleteEntry(entry);
> >>
> >>return SUCCESS;
> >>}
> >>
> >>private JournalEntry entry;
> >>private GoalToAchieve goalToAchieve;
> >>private long id;
> >>
> >> ... + getters and setters
> >>
> >> I guess right now, my problem has become how to pass a parameter
> >> referring to en entry (the mark field) to the delete action. Next, I
> >> would do a lookup within the action to find the entry object and
> >> remove it from the parent object collection, by calling
> >> deleteEntry(JournalEntry entry)
> >>
> >> On Mon, Jul 13, 2009 at 9:16 AM, Greg Lindholm
> >> wrote:
> >> > You are not providing enough information for anyone to help you. Since
> >> you
> >> > have changed your object and the jsp you had better include them with
> any
> >> > request.
> >> >
> >> >
> >> > On Mon, Jul 13, 2009 at 9:51 AM, Dimitrios Christodoulakis <
> >> > dimi@gmail.com> wrote:
> >> >
> >> >> Yes, that is a great suggestion actually. What I did was to add a new
> >> >> field based
> >> >> System.currentTimeMillis(), but the problem is adding it as a url
> >> >> parameter.
> >> >>
> 

MethodFilterInterceptor

2009-07-13 Thread stanlick

Either I have been asleep at the wheel or have simply lucked into a naming
scheme.  It appears the MethodFilterInterceptor is performing its
include/exclude logic independent of the methods' package name.  Has anyone
been snapped by this?  

Peace,
Scott
-- 
View this message in context: 
http://www.nabble.com/MethodFilterInterceptor-%3Cpackage%3E-tp24465361p24465361.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: Streaming uploading and downloading of big files with Struts, using Common File Upload API

2009-07-13 Thread Wes Wannemacher
I made an attempt at making file uploading capabilities more
pluggable. There is a beta fileupload plugin with info here -

http://cwiki.apache.org/S2PLUGINS/advanced-fileupload-plugin.html

Be aware, you will have to build a snapshot of struts since it depends
on changes that were made after the 2.1.6 release.

There really isn't much to using it, it is mostly backward compatible
with the built-in multipart handler. You just have more configuration
options if you use this plugin. Plus, if you look at the
struts-plugin.xml file, you can see that there is an action where you
can request a json string for status of currently executing uploads.
This way, you could conceivably build a somewhat accurate statusbar.

Check it out and give feedback, that's what'll make it better :)

-Wes

On Mon, Jul 13, 2009 at 12:21 PM, Daniele
Development-ML wrote:
> Hello,
> I'm trying to understand how to use the Streaming API of the Apache File
> Upload Common libraries in conjunction with Struts. I need this as some
> files I need to allow the uploading/download are rather big and should be
> stored in memory.
>
> What I understood is that I need to define a multipart handler and configure
> it to be used in the control element of struts-config.xml. However, I'm a
> bit confused how the handler should be implemented.
>
> Anybody has had a similar experience and can share a suggestion or pointer
> to useful resources (couldn't find very relevant docs for this issues -
> perhaps just searching in the wrong places).
>
> Thanks!
>
> Dan
>



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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



Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Dimitrios Christodoulakis
I made the changes, but the view source indicates that the param
"mark" is not passed.

The url linked is formed like this:

/secure/DeleteEntryForm.action?name=firstName+lastName&id=1

The name and id params are fields of the parent object, the one
containing the collection.

Actually, I tried with all fields taken from the collection object,
like entry, and date but none gets passed as a param. Only properties
exposed by the parent object, goalToAchieve are passed, shouldn't I be
able to point to a field within a collection object too?

It looks like individual collection object properties can be viewed
using the iterator/display, but cannot be "captured" or passed as
parameters for any other uses... unless I am missing something, or
doing something wrong.


On Mon, Jul 13, 2009 at 10:50 AM, Greg Lindholm wrote:
> Looks like you need to change entry.mark to just mark and remove the
> . Also you probably don't need to pass both
> the name and id of the parent object.
>
> 
>       
>       
>   
> ">Remove
>
>
> On Mon, Jul 13, 2009 at 10:48 AM, Dimitrios Christodoulakis <
> dimi@gmail.com> wrote:
>
>> Thanks for letting me know. Alright, so:
>>
>> This is the parent class:
>>
>> @Entity
>> public class GoalToAchieve {
>> @Id @GeneratedValue
>> private Long id;
>>
>> @org.hibernate.annotations.CollectionOfElements
>> @JoinTable (name="GoalToAchieve_entry",
>> joincolum...@joincolumn(name="goalToAchieve_id"))
>> private Set entries = new HashSet();
>>
>>        public Set getEntries() {
>>                return entries;
>>        }
>>        public void setEntries(SortedSet entries) {
>>                this.entries = entries;
>>        }
>>
>>        public void addEntry(JournalEntry newEntry){
>>                entries.add(newEntry);
>>        }
>>
>>        public void deleteEntry(JournalEntry entry){
>>                entries.remove(entry);
>>        }
>> ..plus some other standard fields with getters and setters
>>
>> This is the child-class:
>>
>> @Embeddable
>> public class JournalEntry {
>> @org.hibernate.annotations.Parent
>> private GoalToAchieve goalToAchieve;
>>
>> @Column
>> private Long mark;
>> public Long getMark() {
>>        return mark;
>> }
>> public void setMark(long mark){
>>        this.mark = mark;
>>         }
>>
>> @Column(length = 255, nullable = false)
>> private String entry;
>>
>> @Temporal(TemporalType.TIMESTAMP)
>> @Column(nullable = false, updatable = false)
>> private Date insertDate = new Date();
>>
>> ..plus the rest getters and setters
>>
>> And this this the jsp part where I display the collection:
>>
>> 
>> 
>>        
>>        > defaultorder="ascending" title="TimeStamp"/>
>>        
>>  
>> 
>>        
>>    
>>    ">Edit
>> 
>> 
>> 
>>         
>>         
>>        
>>        
>>    
>> ">Remove
>> 
>> 
>> 
>>
>> ..and the delete action, which should take an entry reference and
>> remove it from the collections looks like this:
>>
>> public class DeleteEntry extends ActionSupport{
>> public String execute(){
>>                goalToAchieve.deleteEntry(entry);
>>
>>                return SUCCESS;
>>        }
>>
>>        private JournalEntry entry;
>>        private GoalToAchieve goalToAchieve;
>>        private long id;
>>
>> ... + getters and setters
>>
>> I guess right now, my problem has become how to pass a parameter
>> referring to en entry (the mark field) to the delete action. Next, I
>> would do a lookup within the action to find the entry object and
>> remove it from the parent object collection, by calling
>> deleteEntry(JournalEntry entry)
>>
>> On Mon, Jul 13, 2009 at 9:16 AM, Greg Lindholm
>> wrote:
>> > You are not providing enough information for anyone to help you. Since
>> you
>> > have changed your object and the jsp you had better include them with any
>> > request.
>> >
>> >
>> > On Mon, Jul 13, 2009 at 9:51 AM, Dimitrios Christodoulakis <
>> > dimi@gmail.com> wrote:
>> >
>> >> Yes, that is a great suggestion actually. What I did was to add a new
>> >> field based
>> >> System.currentTimeMillis(), but the problem is adding it as a url
>> >> parameter.
>> >>
>> >> For example, I am trying to add it as a url parameter below:
>> >>
>> >> 
>> >> 
>> >> 
>> >>  ">Edit
>> >>
>> >> But, the only param passed is the fullName. The mark is not added to
>> >> the url string. I think this is because the only object available on
>> >> the valuestack is goalToAchieve, and using deeper notation I can
>> >> reference as deep as the "entries" collection. But not to fields of
>> >> each entry object. In other words, the display or iterator help me
>> >> view the collection objects, but not extract and use any of their
>> >> fields... I am not sure why this is happening, or if I am doing
>> >> something wrong.
>> >>
>> >
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>


Streaming uploading and downloading of big files with Struts, using Common File Upload API

2009-07-13 Thread Daniele Development-ML
Hello,
I'm trying to understand how to use the Streaming API of the Apache File
Upload Common libraries in conjunction with Struts. I need this as some
files I need to allow the uploading/download are rather big and should be
stored in memory.

What I understood is that I need to define a multipart handler and configure
it to be used in the control element of struts-config.xml. However, I'm a
bit confused how the handler should be implemented.

Anybody has had a similar experience and can share a suggestion or pointer
to useful resources (couldn't find very relevant docs for this issues -
perhaps just searching in the wrong places).

Thanks!

Dan


Re: validwhen question

2009-07-13 Thread Lukasz Lenart
2009/7/13 Odelya YomTov :
> But I don't see that it works! Why?

Did you try like this?

data.category != \'empty\'


Regards
-- 
Lukasz
http://www.lenart.org.pl/
http://dailylog.lenart.org.pl/

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



Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Greg Lindholm
Looks like you need to change entry.mark to just mark and remove the
. Also you probably don't need to pass both
the name and id of the parent object.


   
   
   
">Remove


On Mon, Jul 13, 2009 at 10:48 AM, Dimitrios Christodoulakis <
dimi@gmail.com> wrote:

> Thanks for letting me know. Alright, so:
>
> This is the parent class:
>
> @Entity
> public class GoalToAchieve {
> @Id @GeneratedValue
> private Long id;
>
> @org.hibernate.annotations.CollectionOfElements
> @JoinTable (name="GoalToAchieve_entry",
> joincolum...@joincolumn(name="goalToAchieve_id"))
> private Set entries = new HashSet();
>
>public Set getEntries() {
>return entries;
>}
>public void setEntries(SortedSet entries) {
>this.entries = entries;
>}
>
>public void addEntry(JournalEntry newEntry){
>entries.add(newEntry);
>}
>
>public void deleteEntry(JournalEntry entry){
>entries.remove(entry);
>}
> ..plus some other standard fields with getters and setters
>
> This is the child-class:
>
> @Embeddable
> public class JournalEntry {
> @org.hibernate.annotations.Parent
> private GoalToAchieve goalToAchieve;
>
> @Column
> private Long mark;
> public Long getMark() {
>return mark;
> }
> public void setMark(long mark){
>this.mark = mark;
> }
>
> @Column(length = 255, nullable = false)
> private String entry;
>
> @Temporal(TemporalType.TIMESTAMP)
> @Column(nullable = false, updatable = false)
> private Date insertDate = new Date();
>
> ..plus the rest getters and setters
>
> And this this the jsp part where I display the collection:
>
> 
> 
>
> defaultorder="ascending" title="TimeStamp"/>
>
>  
> 
>
>
>">Edit
> 
> 
> 
> 
> 
>
>
>
> ">Remove
> 
> 
> 
>
> ..and the delete action, which should take an entry reference and
> remove it from the collections looks like this:
>
> public class DeleteEntry extends ActionSupport{
> public String execute(){
>goalToAchieve.deleteEntry(entry);
>
>return SUCCESS;
>}
>
>private JournalEntry entry;
>private GoalToAchieve goalToAchieve;
>private long id;
>
> ... + getters and setters
>
> I guess right now, my problem has become how to pass a parameter
> referring to en entry (the mark field) to the delete action. Next, I
> would do a lookup within the action to find the entry object and
> remove it from the parent object collection, by calling
> deleteEntry(JournalEntry entry)
>
> On Mon, Jul 13, 2009 at 9:16 AM, Greg Lindholm
> wrote:
> > You are not providing enough information for anyone to help you. Since
> you
> > have changed your object and the jsp you had better include them with any
> > request.
> >
> >
> > On Mon, Jul 13, 2009 at 9:51 AM, Dimitrios Christodoulakis <
> > dimi@gmail.com> wrote:
> >
> >> Yes, that is a great suggestion actually. What I did was to add a new
> >> field based
> >> System.currentTimeMillis(), but the problem is adding it as a url
> >> parameter.
> >>
> >> For example, I am trying to add it as a url parameter below:
> >>
> >> 
> >> 
> >> 
> >>  ">Edit
> >>
> >> But, the only param passed is the fullName. The mark is not added to
> >> the url string. I think this is because the only object available on
> >> the valuestack is goalToAchieve, and using deeper notation I can
> >> reference as deep as the "entries" collection. But not to fields of
> >> each entry object. In other words, the display or iterator help me
> >> view the collection objects, but not extract and use any of their
> >> fields... I am not sure why this is happening, or if I am doing
> >> something wrong.
> >>
> >
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: [Struts 2.1]Does an alias result exist in struts 2?

2009-07-13 Thread Musachy Barroso
I think the only way to do that currently, is to define the 2 results
with the same location.

musachy

On Mon, Jul 13, 2009 at 8:13 AM, dcabasson wrote:
>
> Hi all,
>
> I am wondering if there is an "alias" result in struts 2.
>
> The use case for such a result type would be for when some of the results
> are the same. Say SUCCESS and INPUT actually go both to the same location,
> it would be nice to be able to define SUCCESS and have INPUT be only an
> alias of SUCCESS.
>
> An even more specific use of that result would be when you define a global
> result in the struts 2 configuration (say HOME), and you want the INPUT
> result to point to this global result of HOME. You have to name your result
> INPUT on that action, for validation purposes, but currently you have no way
> of telling struts this INPUT result is only an alias of the gloabl HOME
> result.
>
> Does that make sense to you guys? Is that worth entering a JIRA ticket for
> that enhancement?
>
> Thanks!
> Denis.
> --
> View this message in context: 
> http://www.nabble.com/-Struts-2.1-Does-an-alias-result-exist-in-struts-2--tp24463634p24463634.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
>
>



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

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



[Struts 2.1]Does an alias result exist in struts 2?

2009-07-13 Thread dcabasson

Hi all,

I am wondering if there is an "alias" result in struts 2.

The use case for such a result type would be for when some of the results
are the same. Say SUCCESS and INPUT actually go both to the same location,
it would be nice to be able to define SUCCESS and have INPUT be only an
alias of SUCCESS.

An even more specific use of that result would be when you define a global
result in the struts 2 configuration (say HOME), and you want the INPUT
result to point to this global result of HOME. You have to name your result
INPUT on that action, for validation purposes, but currently you have no way
of telling struts this INPUT result is only an alias of the gloabl HOME
result.

Does that make sense to you guys? Is that worth entering a JIRA ticket for
that enhancement?

Thanks!
Denis.
-- 
View this message in context: 
http://www.nabble.com/-Struts-2.1-Does-an-alias-result-exist-in-struts-2--tp24463634p24463634.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: Migration from Struts1 to Struts2

2009-07-13 Thread Martin Gainty

take a look at tuning tips described at 
http://cwiki.apache.org/WW/performance-tuning.html

ping back for questions/concerns
Martin 
__ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.






> Date: Mon, 13 Jul 2009 06:31:34 -0700
> From: tajuddi...@yahoo.com
> Subject: Re: Migration from Struts1 to Struts2
> To: user@struts.apache.org
> 
> I'm not sure but do pls check out by including the sitemesh-2.3.jar file and 
> xwork-2.0.6.jar file in your library
> 
> --- On Mon, 7/13/09, Lasantha Pambagoda  wrote:
> 
> 
> From: Lasantha Pambagoda 
> Subject: Migration from Struts1 to Struts2
> To: user@struts.apache.org
> Date: Monday, July 13, 2009, 6:33 AM
> 
> 
> Hi,
> 
> We have migrated struts1 application to struts2. But now once we
> deployed the system the CPU is going 90% to 100% and system is getting
> loaded. In JSP's we are not using struts specific tags or freemaker
> templates. Our JSP files are just plain jsp files only with
> requstScope variables.
> 
> We are using following versions of struts and dependent libraries.
> 
> struts2-core-2.1.6.jar
> struts2-codebehind-plugin-2.1.6.jar
> ognl-2.6.11.jar
> freemarker-2.3.13.jar
> 
> Please let me know if we can do any improvement with out switching
> back to struts1
> 
> Kind Regards
> Lasantha
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 
> 
>   

_
Bing™ finds low fares by predicting when to book. Try it now.
http://www.bing.com/travel/deals/airline-ticket-deals.do?form=MTRHPG&publ=WLHMTAG&crea=TXT_MTRHPG_Travel_Travel_TravelDeals_1x1

Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Dimitrios Christodoulakis
Thanks for the comments Martin, I will try it out!

On Mon, Jul 13, 2009 at 9:46 AM, Martin Gainty wrote:
>
> @Table(name = "TableNameGoesHere")
>
> //the java file would use ForeignKey annotation as described
> @org.hibernate.annotations.ForeignKey(name = "FK_GOALTOACHIEVE_ID")
>
> public class WikiDocument extends WikiFile implements 
> Serializable {
>    public String getHistoricalEntityName() {
>        return "HistoricalWikiDocument";
>    }
>
> and the hibernate configuration file (DatabaseObjects.hbm.xml) would handle 
> the SequenceGeneration
>
>  default-access="field">
>     table="TABLE_NAME_GOES_HERE" polymorphism="explicit">
>        
>             class="org.hibernate.id.enhanced.SequenceStyleGenerator">
>                 name="sequence_name">TABLE_NAME_PRIMARY_KEY__SEQUENCE
>            
>        
>
> WARNING: Despite (albeit brief) commentary offered
> any attempts to provide SEQUENCE generation to subvert SEQUENCE GENERATION by 
> DBA is discouraged ..you do'nt want 2 sequences on same Table
> i would encourage you to coordinate your SEQUENCE generation activity with DBA
>
> fwiw
> Martin Gainty
> __
> Verzicht und Vertraulichkeitanmerkung
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich 
> dem Austausch von Informationen und entfaltet keine rechtliche 
> Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen 
> wir keine Haftung fuer den Inhalt uebernehmen.
>
>
>
>> Date: Mon, 13 Jul 2009 09:43:15 -0400
>> Subject: Re: updating or deleting a component from a collection through      
>>  display tag
>> From: greg.lindh...@gmail.com
>> To: user@struts.apache.org
>>
>> >
>> > Thanks for the reply. Well, entry is an instance of a separate class:
>> >
>> > @Embeddable
>> > public class JournalEntry {
>> > @org.hibernate.annotations.Parent
>> >        private GoalToAchieve goalToAchieve;
>> > @Column(length = 255, nullable = false)
>> >        private String entry;
>> >
>> >       �...@temporal(TemporalType.TIMESTAMP)
>> >       �...@column(nullable = false, updatable = false)
>> >        private Date insertDate = new Date();
>> >
>> > ...plus the getters and setters
>> >
>> > This being a value type embeddable component, it is represented with a
>> > table with only a foreign key to the parent entity it belongs to:
>> > goalToAchieve_id
>> >
>> > So, if I pass the entry String as a parameter (I am not sure if it
>> > would be convenient to have a a few sentences as url params), how can
>> > I turn it into a reference to the object I want to actually remove
>> > from the collection?
>> >
>> > Thanks again
>> >
>> > > You didn't say what 'entry' is, but if it is a String or some primitive
>> > you
>> > > can just pass it as another parameter.
>> > >
>> > > 
>> > >          
>> > >           
>> > > 
>> > >
>> > > Usually, every database entity object has an 'id' property (primary key)
>> > and
>> > > you would just pass the id as a parameter so your action can find the
>> > object
>> > > in the database.
>> > >
>> > > In you browser do a view source on the page to ensure the url is being
>> > > generated correctly with the params you are expecting.
>> > >
>> >
>>
>> You definitely do not want to pass 'entry' as a parameter on the url.
>> Every database object needs some kind of unique key id just for situations
>> like this.
>> Maybe you could use the insertDate as a key (it's probably unique within
>> this context) but it would be better to add a key, perhaps a sequence number
>> so that goalToAchieve_id + seq is the PK.
>
> _
> Lauren found her dream laptop. Find the PC that’s right for you.
> http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290

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



Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Dimitrios Christodoulakis
Thanks for letting me know. Alright, so:

This is the parent class:

@Entity
public class GoalToAchieve {
@Id @GeneratedValue
private Long id;

@org.hibernate.annotations.CollectionOfElements
@JoinTable (name="GoalToAchieve_entry",
joincolum...@joincolumn(name="goalToAchieve_id"))
private Set entries = new HashSet();

public Set getEntries() {
return entries;
}
public void setEntries(SortedSet entries) {
this.entries = entries;
}

public void addEntry(JournalEntry newEntry){
entries.add(newEntry);
}

public void deleteEntry(JournalEntry entry){
entries.remove(entry);
}
..plus some other standard fields with getters and setters

This is the child-class:

@Embeddable
public class JournalEntry {
@org.hibernate.annotations.Parent
private GoalToAchieve goalToAchieve;

@Column
private Long mark;
public Long getMark() {
return mark;
}
public void setMark(long mark){
this.mark = mark;
}

@Column(length = 255, nullable = false)
private String entry;

@Temporal(TemporalType.TIMESTAMP)
@Column(nullable = false, updatable = false)
private Date insertDate = new Date();

..plus the rest getters and setters

And this this the jsp part where I display the collection:






  



">Edit








">Remove




..and the delete action, which should take an entry reference and
remove it from the collections looks like this:

public class DeleteEntry extends ActionSupport{
public String execute(){
goalToAchieve.deleteEntry(entry);

return SUCCESS;
}

private JournalEntry entry;
private GoalToAchieve goalToAchieve;
private long id;

... + getters and setters

I guess right now, my problem has become how to pass a parameter
referring to en entry (the mark field) to the delete action. Next, I
would do a lookup within the action to find the entry object and
remove it from the parent object collection, by calling
deleteEntry(JournalEntry entry)

On Mon, Jul 13, 2009 at 9:16 AM, Greg Lindholm wrote:
> You are not providing enough information for anyone to help you. Since you
> have changed your object and the jsp you had better include them with any
> request.
>
>
> On Mon, Jul 13, 2009 at 9:51 AM, Dimitrios Christodoulakis <
> dimi@gmail.com> wrote:
>
>> Yes, that is a great suggestion actually. What I did was to add a new
>> field based
>> System.currentTimeMillis(), but the problem is adding it as a url
>> parameter.
>>
>> For example, I am trying to add it as a url parameter below:
>>
>> 
>> 
>> 
>>  ">Edit
>>
>> But, the only param passed is the fullName. The mark is not added to
>> the url string. I think this is because the only object available on
>> the valuestack is goalToAchieve, and using deeper notation I can
>> reference as deep as the "entries" collection. But not to fields of
>> each entry object. In other words, the display or iterator help me
>> view the collection objects, but not extract and use any of their
>> fields... I am not sure why this is happening, or if I am doing
>> something wrong.
>>
>

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



RE: updating or deleting a component from a collection through display tag

2009-07-13 Thread Martin Gainty

@Table(name = "TableNameGoesHere")

//the java file would use ForeignKey annotation as described
@org.hibernate.annotations.ForeignKey(name = "FK_GOALTOACHIEVE_ID")

public class WikiDocument extends WikiFile implements 
Serializable {
public String getHistoricalEntityName() {
return "HistoricalWikiDocument";
}

and the hibernate configuration file (DatabaseObjects.hbm.xml) would handle the 
SequenceGeneration





TABLE_NAME_PRIMARY_KEY__SEQUENCE



WARNING: Despite (albeit brief) commentary offered 
any attempts to provide SEQUENCE generation to subvert SEQUENCE GENERATION by 
DBA is discouraged ..you do'nt want 2 sequences on same Table
i would encourage you to coordinate your SEQUENCE generation activity with DBA

fwiw
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.



> Date: Mon, 13 Jul 2009 09:43:15 -0400
> Subject: Re: updating or deleting a component from a collection through   
> display tag
> From: greg.lindh...@gmail.com
> To: user@struts.apache.org
> 
> >
> > Thanks for the reply. Well, entry is an instance of a separate class:
> >
> > @Embeddable
> > public class JournalEntry {
> > @org.hibernate.annotations.Parent
> >private GoalToAchieve goalToAchieve;
> > @Column(length = 255, nullable = false)
> >private String entry;
> >
> >@Temporal(TemporalType.TIMESTAMP)
> >@Column(nullable = false, updatable = false)
> >private Date insertDate = new Date();
> >
> > ...plus the getters and setters
> >
> > This being a value type embeddable component, it is represented with a
> > table with only a foreign key to the parent entity it belongs to:
> > goalToAchieve_id
> >
> > So, if I pass the entry String as a parameter (I am not sure if it
> > would be convenient to have a a few sentences as url params), how can
> > I turn it into a reference to the object I want to actually remove
> > from the collection?
> >
> > Thanks again
> >
> > > You didn't say what 'entry' is, but if it is a String or some primitive
> > you
> > > can just pass it as another parameter.
> > >
> > > 
> > >  
> > >   
> > > 
> > >
> > > Usually, every database entity object has an 'id' property (primary key)
> > and
> > > you would just pass the id as a parameter so your action can find the
> > object
> > > in the database.
> > >
> > > In you browser do a view source on the page to ensure the url is being
> > > generated correctly with the params you are expecting.
> > >
> >
> 
> You definitely do not want to pass 'entry' as a parameter on the url.
> Every database object needs some kind of unique key id just for situations
> like this.
> Maybe you could use the insertDate as a key (it's probably unique within
> this context) but it would be better to add a key, perhaps a sequence number
> so that goalToAchieve_id + seq is the PK.

_
Lauren found her dream laptop. Find the PC that’s right for you.
http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290

Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Greg Lindholm
You are not providing enough information for anyone to help you. Since you
have changed your object and the jsp you had better include them with any
request.


On Mon, Jul 13, 2009 at 9:51 AM, Dimitrios Christodoulakis <
dimi@gmail.com> wrote:

> Yes, that is a great suggestion actually. What I did was to add a new
> field based
> System.currentTimeMillis(), but the problem is adding it as a url
> parameter.
>
> For example, I am trying to add it as a url parameter below:
>
> 
> 
> 
>  ">Edit
>
> But, the only param passed is the fullName. The mark is not added to
> the url string. I think this is because the only object available on
> the valuestack is goalToAchieve, and using deeper notation I can
> reference as deep as the "entries" collection. But not to fields of
> each entry object. In other words, the display or iterator help me
> view the collection objects, but not extract and use any of their
> fields... I am not sure why this is happening, or if I am doing
> something wrong.
>


Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Dimitrios Christodoulakis
Yes, that is a great suggestion actually. What I did was to add a new
field based
System.currentTimeMillis(), but the problem is adding it as a url parameter.

For example, I am trying to add it as a url parameter below:




 ">Edit

But, the only param passed is the fullName. The mark is not added to
the url string. I think this is because the only object available on
the valuestack is goalToAchieve, and using deeper notation I can
reference as deep as the "entries" collection. But not to fields of
each entry object. In other words, the display or iterator help me
view the collection objects, but not extract and use any of their
fields... I am not sure why this is happening, or if I am doing
something wrong.

On Mon, Jul 13, 2009 at 8:43 AM, Greg Lindholm wrote:
>>
>> Thanks for the reply. Well, entry is an instance of a separate class:
>>
>> @Embeddable
>> public class JournalEntry {
>> @org.hibernate.annotations.Parent
>>        private GoalToAchieve goalToAchieve;
>> @Column(length = 255, nullable = false)
>>        private String entry;
>>
>>       �...@temporal(TemporalType.TIMESTAMP)
>>       �...@column(nullable = false, updatable = false)
>>        private Date insertDate = new Date();
>>
>> ...plus the getters and setters
>>
>> This being a value type embeddable component, it is represented with a
>> table with only a foreign key to the parent entity it belongs to:
>> goalToAchieve_id
>>
>> So, if I pass the entry String as a parameter (I am not sure if it
>> would be convenient to have a a few sentences as url params), how can
>> I turn it into a reference to the object I want to actually remove
>> from the collection?
>>
>> Thanks again
>>
>> > You didn't say what 'entry' is, but if it is a String or some primitive
>> you
>> > can just pass it as another parameter.
>> >
>> > 
>> >          
>> >           
>> > 
>> >
>> > Usually, every database entity object has an 'id' property (primary key)
>> and
>> > you would just pass the id as a parameter so your action can find the
>> object
>> > in the database.
>> >
>> > In you browser do a view source on the page to ensure the url is being
>> > generated correctly with the params you are expecting.
>> >
>>
>
> You definitely do not want to pass 'entry' as a parameter on the url.
> Every database object needs some kind of unique key id just for situations
> like this.
> Maybe you could use the insertDate as a key (it's probably unique within
> this context) but it would be better to add a key, perhaps a sequence number
> so that goalToAchieve_id + seq is the PK.
>

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



Re: Migration from Struts1 to Struts2

2009-07-13 Thread Lasantha Pambagoda
Dear Uddin,

Thanks for the reply. But we are are already included xwork-2.1.2.jar
and we are not using any sitemesh features in out project. Anyhow I
have included sitemesh jar file and still no difference.

Best Regards
Lasantha

On Mon, Jul 13, 2009 at 5:31 PM, taj uddin wrote:
> I'm not sure but do pls check out by including the sitemesh-2.3.jar file and 
> xwork-2.0.6.jar file in your library
>
> --- On Mon, 7/13/09, Lasantha Pambagoda  wrote:
>
>
> From: Lasantha Pambagoda 
> Subject: Migration from Struts1 to Struts2
> To: user@struts.apache.org
> Date: Monday, July 13, 2009, 6:33 AM
>
>
> Hi,
>
> We have migrated struts1 application to struts2. But now once we
> deployed the system the CPU is going 90% to 100% and system is getting
> loaded. In JSP's we are not using struts specific tags or freemaker
> templates. Our JSP files are just plain jsp files only with
> requstScope variables.
>
> We are using following versions of struts and dependent libraries.
>
> struts2-core-2.1.6.jar
> struts2-codebehind-plugin-2.1.6.jar
> ognl-2.6.11.jar
> freemarker-2.3.13.jar
>
> Please let me know if we can do any improvement with out switching
> back to struts1
>
> Kind Regards
> Lasantha
>
> -
> 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: updating or deleting a component from a collection through display tag

2009-07-13 Thread Greg Lindholm
>
> Thanks for the reply. Well, entry is an instance of a separate class:
>
> @Embeddable
> public class JournalEntry {
> @org.hibernate.annotations.Parent
>private GoalToAchieve goalToAchieve;
> @Column(length = 255, nullable = false)
>private String entry;
>
>@Temporal(TemporalType.TIMESTAMP)
>@Column(nullable = false, updatable = false)
>private Date insertDate = new Date();
>
> ...plus the getters and setters
>
> This being a value type embeddable component, it is represented with a
> table with only a foreign key to the parent entity it belongs to:
> goalToAchieve_id
>
> So, if I pass the entry String as a parameter (I am not sure if it
> would be convenient to have a a few sentences as url params), how can
> I turn it into a reference to the object I want to actually remove
> from the collection?
>
> Thanks again
>
> > You didn't say what 'entry' is, but if it is a String or some primitive
> you
> > can just pass it as another parameter.
> >
> > 
> >  
> >   
> > 
> >
> > Usually, every database entity object has an 'id' property (primary key)
> and
> > you would just pass the id as a parameter so your action can find the
> object
> > in the database.
> >
> > In you browser do a view source on the page to ensure the url is being
> > generated correctly with the params you are expecting.
> >
>

You definitely do not want to pass 'entry' as a parameter on the url.
Every database object needs some kind of unique key id just for situations
like this.
Maybe you could use the insertDate as a key (it's probably unique within
this context) but it would be better to add a key, perhaps a sequence number
so that goalToAchieve_id + seq is the PK.


Re: "Nothing found to display" from display tag with struts 2

2009-07-13 Thread Wim De Smet
Hi,

I think this is a bit odd as I'm using the display tag (1.2) with
struts 2 (2.1.6) and I can't get it to work without using .
Are there any special interceptors or anything one needs to have
enabled for this to work? I think I have the default stack on that
particular page so I assume the tag should be working but it doesn't.
The list is set on the action as usual and works when iterating and
when using .

regards,
Wim

On Sat, Jul 11, 2009 at 7:26 PM, dusty wrote:
>
> That sounds like a troubling one, based on what you describe it should work.
> Especially if the struts iterator works on the same JSP page.   What version
> of Struts and DisplayTag are you using.
>
> There was a time when you had to use the  tag and a time when you
> did not.  Have you tried without the s:set tag?
>
>
>
> Dimitrios Christodoulakis wrote:
>>
>> Hello list,
>>
>> I am exposing a collection called "entries" in my action class
>> (Set entries;), with all the appropriate getters and
>> setters. In the result jsp of this action I am using the display tag
>> to output the content of the collection:
>>
>> 
>>               
>>                       
>>                       > defaultorder="ascending"/>
>>               
>>
>> But the message I get on the jsp page is: "Nothing found to display".
>> (Its not an exception, this message is printed on the regulat html
>> output page). I am certain that the rows exist on the underlying db, I
>> am using mysql query browser to check.
>>
>> So, I have followed instructions about struts2 and the display tag
>> found in different places:
>> http://www.nabble.com/Struts-2---DisplayTag-example-td17694341.html
>> http://www.manning-sandbox.com/thread.jspa?messageID=76885
>> http://appfuse.org/display/APF/Using+Struts+2
>>
>> But I can't get this simple task to work. The objective is to simply
>> display the table. In contrast, using just the struts2 tags, the
>> following works fine:
>>
>> 
>>                       
>>                               
>>                                       
>>                                       
>>                               
>>                       
>>               
>>
>> However, since I wish to use the display tag for further formatting
>> and sorting, I was hoping if anyone had any thoughts as to why my code
>> above finds nothing to display. I can't tell if it finds just an empty
>> collection, or doesn't find the collection at all.
>>
>> thanks for any advice.
>>
>> Regards.
>>
>> -
>> 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/%22Nothing-found-to-display%22-from-display-tag-with-struts-2-tp24441738p24442243.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: Migration from Struts1 to Struts2

2009-07-13 Thread taj uddin
I'm not sure but do pls check out by including the sitemesh-2.3.jar file and 
xwork-2.0.6.jar file in your library

--- On Mon, 7/13/09, Lasantha Pambagoda  wrote:


From: Lasantha Pambagoda 
Subject: Migration from Struts1 to Struts2
To: user@struts.apache.org
Date: Monday, July 13, 2009, 6:33 AM


Hi,

We have migrated struts1 application to struts2. But now once we
deployed the system the CPU is going 90% to 100% and system is getting
loaded. In JSP's we are not using struts specific tags or freemaker
templates. Our JSP files are just plain jsp files only with
requstScope variables.

We are using following versions of struts and dependent libraries.

struts2-core-2.1.6.jar
struts2-codebehind-plugin-2.1.6.jar
ognl-2.6.11.jar
freemarker-2.3.13.jar

Please let me know if we can do any improvement with out switching
back to struts1

Kind Regards
Lasantha

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




  

Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Dimitrios Christodoulakis
Thanks for the reply. Well, entry is an instance of a separate class:

@Embeddable
public class JournalEntry {
@org.hibernate.annotations.Parent
private GoalToAchieve goalToAchieve;
@Column(length = 255, nullable = false)
private String entry;

@Temporal(TemporalType.TIMESTAMP)
@Column(nullable = false, updatable = false)
private Date insertDate = new Date();

...plus the getters and setters

This being a value type embeddable component, it is represented with a
table with only a foreign key to the parent entity it belongs to:
goalToAchieve_id

So, if I pass the entry String as a parameter (I am not sure if it
would be convenient to have a a few sentences as url params), how can
I turn it into a reference to the object I want to actually remove
from the collection?

Thanks again

On Mon, Jul 13, 2009 at 8:17 AM, Greg Lindholm wrote:
>>
>>
>> I have successfully used the display tag to iterate over a collection
>> which is exposed in an action class. On each row in addition to the
>> columns displaying the fields of each object in the collection, I
>> embed two more struts-tag urls: Update and Remove.
>>
>> The objective is to have an extra two columns for every row in the
>> table giving the ability to update or delete each record:
>>
>> 
>>        
>>        > defaultorder="ascending" title="TimeStamp"/>
>>        > value="%{goalToAchieve.owner.fullName}" />
>>                        
>>                        ">Edit
>>        > value="%{goalToAchieve.owner.fullName}" />
>>                                        
>>                                       
>>                                       ">Remove
>> 
>>
>> I am having trouble passing the entry property, (or reference to it)
>> to the url targeting the update or delete action. The entries
>> collection consists of value type, embeddable objects. I am aware of
>> how to pass parameters to the linking url, but my issue is passing a
>> reference to the "entry" property of each row, to the update or delete
>> action for the same row.
>>
>>
> You didn't say what 'entry' is, but if it is a String or some primitive you
> can just pass it as another parameter.
>
> 
>          
>           
> 
>
> Usually, every database entity object has an 'id' property (primary key) and
> you would just pass the id as a parameter so your action can find the object
> in the database.
>
> In you browser do a view source on the page to ensure the url is being
> generated correctly with the params you are expecting.
>

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



Re: not displaying errors!

2009-07-13 Thread Greg Lindholm
If you want to preserve errors and messages across a redirect you can you
this interceptor:

http://glindholm.wordpress.com/2008/07/02/preserving-messages-across-a-redirect-in-struts-2/


On Sun, Jul 12, 2009 at 10:18 AM, taj uddin  wrote:

> Hi Kavitha,
>
>The action error message will not be carried to the JSP page if u r
> doing the redirect-action. The Message will be lost. If so, then u have to
> store the error message in the session and retrieve it in the redirected
> action class.
> In case, if u r not doing the redirect-action, then please remove the id
> attribute fron the  tag and try again.
>
> My guess would be, u must be redirecting the action on success.
>
> --- On Thu, 7/9/09, Kavita Mehta  wrote:
>
>
> From: Kavita Mehta 
> Subject:  not displaying errors!
> To: "Struts Users Mailing List" 
> Date: Thursday, July 9, 2009, 9:14 AM
>
>
> Hi,
> I am using Struts 2.0  and I am not able to display the action errors in
> my JSP.
>
> Action class code :
>
> if( ( getSelectedlocation() == null ) || getSelectedlocation().compareTo(
> "" ) == 0
> && ( (getLocation() == null ) ||(
> getLocation().compareTo( "" ) == 0 )))
> {
> mLog.warn( "Location not
> specified. Added Error message" );
> addActionError( "Please specify a
> Location for the message . " );
> }
>
>
> JSP code :
>
> 
> 
>   
>
>
> The error is added successfully as i can see from the logs but it is not
> getting displayed  on the JSP ..any pointers ?
>
>
> Thanks,
> Kavita
>
>
>
>
>
>
> *DISCLAIMER*
>
> This message and/or attachment(s) contained here are confidential,
> proprietary to HUGHES SYSTIQUE and its customers.
> Contents may be privileged or otherwise protected by law. The information
> is solely intended for the entity it is
> addressed to. If you are not the intended recipient of this message, it is
> strictly prohibited to read, forward,
> print, retain, copy or disseminate this message or any part of it. If you
> have received this e-mail in error,
> please notify the sender immediately and delete the message.
>
>
> 
>
>
>
>
>


Re: updating or deleting a component from a collection through display tag

2009-07-13 Thread Greg Lindholm
>
>
> I have successfully used the display tag to iterate over a collection
> which is exposed in an action class. On each row in addition to the
> columns displaying the fields of each object in the collection, I
> embed two more struts-tag urls: Update and Remove.
>
> The objective is to have an extra two columns for every row in the
> table giving the ability to update or delete each record:
>
> 
>
> defaultorder="ascending" title="TimeStamp"/>
> value="%{goalToAchieve.owner.fullName}" />
>
>">Edit
> value="%{goalToAchieve.owner.fullName}" />
>
>   
>   ">Remove
> 
>
> I am having trouble passing the entry property, (or reference to it)
> to the url targeting the update or delete action. The entries
> collection consists of value type, embeddable objects. I am aware of
> how to pass parameters to the linking url, but my issue is passing a
> reference to the "entry" property of each row, to the update or delete
> action for the same row.
>
>
You didn't say what 'entry' is, but if it is a String or some primitive you
can just pass it as another parameter.


  
   


Usually, every database entity object has an 'id' property (primary key) and
you would just pass the id as a parameter so your action can find the object
in the database.

In you browser do a view source on the page to ensure the url is being
generated correctly with the params you are expecting.


Re: problem with deleting objects from a collection

2009-07-13 Thread Dimitrios Christodoulakis
I think I might have an idea why the iterator or display tag do not
allow for working with collection items.

In the past I used form tags (like select) to prompt the user to make
a selection from a menu, my thought is that since I was using form
tags, by submitting the form, the property (item from the collection)
is passed to the valuestack and the action can work with it.

But an iterator or a display tag do not necessarily put properties on
the valuestack. Is this correct? I was wondering if I could use a set,
or push tag to either store the property to the scope or put it on the
top of the valuestack that way? Would you say this is a valid
strategy?

This has been troubling me for a few days, so I hope it is alright to
post my new thought on this. Thank you for any new input.

On Sun, Jul 12, 2009 at 5:16 PM, Dimitrios
Christodoulakis wrote:
> Thanks Dave,
>
> Yes, the  isn't supposed to be there  Thanks for
> pointing this out. Indeed, it has to be an object there, in order to
> do the remove from the collection. Since this value-type component
> (entry) does not have a primary key to look it up from, I am a bit at
> a loss how to continue from here.
>
> If you don't mind, could you explain a little bit further? I have
> successfully removed entity object from collections before because all
> I neede was the primary key to be passed to the delete action. Then
> inside the action I did the look up using the key and removed the
> object. But with this type of object I have hit a roadblock.
>
> I appreciate any further help.
>
>
> This is the class:
>
> @Embeddable
> public class JournalEntry {
>
>       �...@org.hibernate.annotations.parent
>        private GoalToAchieve goalToAchieve;
>
>       �...@column(length = 255, nullable = false)
>        private String entry;
>
>       �...@temporal(TemporalType.TIMESTAMP)
>       �...@column(nullable = false, updatable = false)
>        private Date insertDate = new Date();
>
>
> plus the appropriate getters and setters..
>
> On Sun, Jul 12, 2009 at 5:03 PM, Dave Newton wrote:
>> Dimitrios Christodoulakis wrote:
>>>
>>> I tried adding one more column like this, hoping the entry property
>>> will be available to the DeleteEntry action via the mini-form.
>>>
>>> 
>>> 
>>>    
>>>    
>>>   
>>> 
>>> 
>>
>> What's that  supposed to be doing?
>>
>> It's not a form field; there's no entry reference being passed back. Even if
>> it *was* a form field it's still not passing a *reference* back--forms
>> *only* submit strings. Always. If you want an actual *entry* object there
>> either needs to be some type conversion, database retrieval, etc.
>>
>> Dave
>>
>> -
>> 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



Uploading large files

2009-07-13 Thread Daniele Development-ML
Hello,
I am developing a web application that needs to allow uploading of file of
sizes ranging 200Mb - 1 GB. Currently, I'm doing this with the
FileUploadAction, which however loads the entire file in memory - as I
understood

I remember once I came across another possible solution, which allows the
serialization of the file data as it is received from the server.

Unfortunately, I can't find this reference anymore.

Anybody knows/has an hint about that?

Thanks,

Dan


validwhen question

2009-07-13 Thread Odelya YomTov
Hi!

I have html:select with countries list
I want to make sure that the user clicked on a value
Jsp:

--



validation.xm




test

(*this* != 'empty')





But I don't see that it works! Why?



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



Migration from Struts1 to Struts2

2009-07-13 Thread Lasantha Pambagoda
Hi,

We have migrated struts1 application to struts2. But now once we
deployed the system the CPU is going 90% to 100% and system is getting
loaded. In JSP's we are not using struts specific tags or freemaker
templates. Our JSP files are just plain jsp files only with
requstScope variables.

We are using following versions of struts and dependent libraries.

struts2-core-2.1.6.jar
struts2-codebehind-plugin-2.1.6.jar
ognl-2.6.11.jar
freemarker-2.3.13.jar

Please let me know if we can do any improvement with out switching
back to struts1

Kind Regards
Lasantha

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



Re: Struts2, JQuery and JSON result to create a dynamic ajax website

2009-07-13 Thread GF
You're right too ;-)
I didn't want to substitute to the plugin documentation.
I'd prefer the "include properties" behaviour anyway.

I believe a good idea could be to use @JsonInclude annotation on the
entity properties to define (just ONE time on the entities) which of
their properties are "safe to return" in the json serialization

Thank You again.

On Mon, Jul 13, 2009 at 9:33 AM, Nils-Helge Garli
Hegvik wrote:
> Did you look at the "Excluding properties" example in the json plugin
> documentation?
>
> Nils-H
>
> On Mon, Jul 13, 2009 at 9:15 AM, GF wrote:
>> You're absolutely right,
>> but there is a "security reason", in real-world application, the
>> objects i get from business service, are usually JPA entities, and
>> putting a "full JPA entity" on the json result will lead to issues in
>> the case there are some properties of that object that have to kept
>> "hidden" to the end users.. (i.e. in the case of a "User" entity,
>> would a not good idea to return in the json result its hashed
>> password).
>>
>> Your suggestion would surely lead to a "clean code" but an
>> unexperienced programmer might show to its website user some
>> information he didn't want to...
>>
>>
>>
>>
>>> A quick look at your tutorial makes me think you are underestimating the
>>> capability of the JSON plugin. It is fully capable of serializing most java
>>> objects to JSON. Rather than explicitly creating a hashmap, why not put the
>>> 'item' on the action and then set a json result with item configured as the
>>> root object.
>>
>> -
>> 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: Struts2, JQuery and JSON result to create a dynamic ajax website

2009-07-13 Thread Nils-Helge Garli Hegvik
Did you look at the "Excluding properties" example in the json plugin
documentation?

Nils-H

On Mon, Jul 13, 2009 at 9:15 AM, GF wrote:
> You're absolutely right,
> but there is a "security reason", in real-world application, the
> objects i get from business service, are usually JPA entities, and
> putting a "full JPA entity" on the json result will lead to issues in
> the case there are some properties of that object that have to kept
> "hidden" to the end users.. (i.e. in the case of a "User" entity,
> would a not good idea to return in the json result its hashed
> password).
>
> Your suggestion would surely lead to a "clean code" but an
> unexperienced programmer might show to its website user some
> information he didn't want to...
>
>
>
>
>> A quick look at your tutorial makes me think you are underestimating the
>> capability of the JSON plugin. It is fully capable of serializing most java
>> objects to JSON. Rather than explicitly creating a hashmap, why not put the
>> 'item' on the action and then set a json result with item configured as the
>> root object.
>
> -
> 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: Struts2, JQuery and JSON result to create a dynamic ajax website

2009-07-13 Thread GF
You're absolutely right,
but there is a "security reason", in real-world application, the
objects i get from business service, are usually JPA entities, and
putting a "full JPA entity" on the json result will lead to issues in
the case there are some properties of that object that have to kept
"hidden" to the end users.. (i.e. in the case of a "User" entity,
would a not good idea to return in the json result its hashed
password).

Your suggestion would surely lead to a "clean code" but an
unexperienced programmer might show to its website user some
information he didn't want to...




> A quick look at your tutorial makes me think you are underestimating the
> capability of the JSON plugin. It is fully capable of serializing most java
> objects to JSON. Rather than explicitly creating a hashmap, why not put the
> 'item' on the action and then set a json result with item configured as the
> root object.

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



RE: Struts2, JQuery and JSON result to create a dynamic ajax website

2009-07-13 Thread Vishnu Vyasan Nelliparmbil
Good Stuff, 

Thanks a Lot. Expecting more in future.

-Original Message-
From: GF [mailto:gan...@gmail.com] 
Sent: Monday, July 13, 2009 10:10 AM
To: Struts Users Mailing List; fr...@meruvian.org
Subject: Re: Struts2, JQuery and JSON result to create a dynamic ajax
website

Thank You for the nice comment.
I just wrote some code snippets for the tutorials.. i didn't have
enough time to build a full eclipse web project, if you have some
difficulties, ask :-)

On Mon, Jul 13, 2009 at 12:33 AM, Frans Thamura
wrote:
> Cool. Can I have the full code? Frans

-
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: Struts2, JQuery and JSON result to create a dynamic ajax website

2009-07-13 Thread GF
Thank You for the nice comment.
I just wrote some code snippets for the tutorials.. i didn't have
enough time to build a full eclipse web project, if you have some
difficulties, ask :-)

On Mon, Jul 13, 2009 at 12:33 AM, Frans Thamura wrote:
> Cool. Can I have the full code? Frans

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