Re: How to compare String in OGNL?

2008-01-07 Thread Shuai Zheng
Just find out the problem, the code does not work because when we use one
character like 'T',, the string compare will always fail, I guess it is
because the OGNL treat it as a char type.

The following code works fine:

 


 


It is not a good solution, but anyway it works.

Is it a bug?

Regards,

Zheng Shuai

On Jan 7, 2008 10:09 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

> I don't think you can do it in one line but you can do it this way:
>
> 
>  
> 
> 
>  
> 
> Hoping it helps.
>
> Thanks.
>
> On Jan 7, 2008 6:44 AM, Shuai Zheng <[EMAIL PROTECTED]> wrote:
>
> > Dear All,
> >
> > I want to know how to compare String using OGNL in jsp page for struts
> 2:
> >
> > I have following codes:
> >
> > ,
> >
> > But always nothing return, and I try many different ways but the
> operator
> > ==
> > looks like can't support String type.
> >
> > I believe there should have a simple way to do it or I make some stupid
> > mistakes but I can't find it out by myself
> >
> > Thanks very much,
> >
> > Regards,
> >
> > Zheng Shuai
> >
>


Re: How to compare String in OGNL?

2008-01-07 Thread Shuai Zheng
Dear Lei,

Thanks a lot, it works. Actually I tried this before, but it does not work,
I don't what kind of stupid mistake I made previously:)

Regards,

Zheng Shuai

On Jan 7, 2008 10:09 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

> I don't think you can do it in one line but you can do it this way:
>
> 
>  
> 
> 
>  
> 
> Hoping it helps.
>
> Thanks.
>
> On Jan 7, 2008 6:44 AM, Shuai Zheng <[EMAIL PROTECTED]> wrote:
>
> > Dear All,
> >
> > I want to know how to compare String using OGNL in jsp page for struts
> 2:
> >
> > I have following codes:
> >
> > ,
> >
> > But always nothing return, and I try many different ways but the
> operator
> > ==
> > looks like can't support String type.
> >
> > I believe there should have a simple way to do it or I make some stupid
> > mistakes but I can't find it out by myself
> >
> > Thanks very much,
> >
> > Regards,
> >
> > Zheng Shuai
> >
>


How to compare String in OGNL?

2008-01-07 Thread Shuai Zheng
Dear All,

I want to know how to compare String using OGNL in jsp page for struts 2:

I have following codes:

,

But always nothing return, and I try many different ways but the operator ==
looks like can't support String type.

I believe there should have a simple way to do it or I make some stupid
mistakes but I can't find it out by myself

Thanks very much,

Regards,

Zheng Shuai


How to format the decimal

2007-06-08 Thread Shuai Zheng

Dear All,

I want to keep all the numeric in my system with 2 decimal places only. What
is the best way to do it?

I try to get a DecimalFormat instance in the page (as a getter method of the
action class), but it looks like stupid. I think I should miss some places
in the document but I can't find related information by myself.

Please help, any suggestions are welcome.

Regards,

Zheng Shuai


Re: File upload fails first time, then works after page reload

2007-03-29 Thread Shuai Zheng

co-ask

I face the same problem, the upload fails(the backend can't get any
parameter value -- all are nulls). Anybody know how to solve it completely?

Regards,

Zheng Shuai

On 3/29/07, Kurapica <[EMAIL PROTECTED]> wrote:


I replace the jsp file with a pure HTML file and let it works with
servlet. Now the ploblem happens occasionally, about one fail in ten
submits.

2007/3/29, Kurapica <[EMAIL PROTECTED]>:
> I met the same problem.
>
> When I use struts 2 Action to accept the form, it fails occasionally.
> Then I wrote a servlet to replace the form. With servlet, it always
> fails at first time, and success after press backspace and submit the
> form again.
>
> 2007/3/28, Kelly Morrison <[EMAIL PROTECTED]>:
> > I really don't know if I'm using NTML Authentication: how would I
check
> > that?
> >
> > I managed to work around my problem by getting the request, wrapping
it
> > in a JakartaMultiPartRequest, parsing the request, and retrieving the
> > values to initialize my class. For some reason, the very first time I
> > try to submit, the multipart request doesn't get wrapped and my bean
> > doesn't get initialized properly, but it works after that. It's very
> > puzzling.
> >
> > Thanks for the advice,
> >kell
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, March 27, 2007 11:10 PM
> > To: user@struts.apache.org; user@struts.apache.org
> > Subject: RE: File upload fails first time, then works after page
reload
> >
> > Are you using the Java NTML Authentication method by any chance
(before
> > reaching this page or on this page) ?
> > NTLM makes tomcat/struts behave erratically. Form posts dont work
> > (Intermittently).
> >
> >
> > 
> >
> > From: Kelly Morrison [mailto:[EMAIL PROTECTED]
> > Sent: Wed 3/28/2007 12:30 AM
> > To: Struts Users Mailing List
> > Subject: File upload fails first time, then works after page reload
> >
> >
> >
> >I'm a Struts newbie having problems with the file upload in Struts
> > 2.0.6 with Tomcat 6.0.10. When I select a file and submit it, the
> > setXXX(), setXXXContentType(), and setXXXFileName() methods in my
action
> > aren't being called. However, if I then hit the Back button and try
> > again, it works and my setters are called.
> >
> >If I set a breakpoint in my upload action's execute() method, I can
> > see that the first time around, all the way down in the
> > CoyoteAdapter.service() method, the "file", "uploadContentType", and
> > "uploadFilename" values are all null (in the
> > request->attributes->table->...etc... data). After backing up and
> > resubmitting, the values are filled in appropriately, so it looks like
> > the problem is occurring long before my upload action is called.
> >
> >I looked through the open issues, but didn't see anything relevant.
I
> > would appreciate any suggestions that might help me debug this.
> >
> >Thanks,
> >   kell
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




How to configure result in the code

2007-03-27 Thread Shuai Zheng

Dear All,

What I want to do is read the files from database and let the user to
download them.

In the showcase example, I find the following configuration:

   
   \images\struts-gif.zip
   
   application/zip
   inputStream
   filename="struts-gif.zip
"
   4096
   
   

But I may not know the filename, contentType, etc (because these files are
uploaded by the user).

Do anybody can tell me how to get the handler of result in the code so I can
set all these information?

Thanks very much,

Regards,

Zheng Shuai


How to overwrite default setting in Struts2

2007-03-14 Thread Shuai Zheng

Dear All,

I try to use my own setting to overwrite the default settings.
Following line is added into my struts.properties:
struts.configuration.files=struts-heal-default.xml,struts-plugin.xml,
struts.xml

I have a struts-heal-default.xml in my classpath to re-define the stack, but
this does not works.

Based on the document:
http://struts.apache.org/2.x/docs/struts-defaultxml.html
There is following words: To exclude the struts-default.xml or to provide
your own version, see the struts.configuration.files setting in
struts.properties .

But this does not works.

BTW: I delete the struts-default.xml from the core.jar, it gives me
exception when startup. So it means the system still try to use this
struts-default.xml. Why?


Regards,

Zheng Shuai


Some tips to help load page faster

2007-02-28 Thread Shuai Zheng

Dear All,

Just optimize my small project which is using struts 2.0.6.  Here is
something that may help to get the faster speed when load a page:

1, Use the default setting of Struts.properties unless you really know the
meaning of the parameter. For example: set
struts.configuration.xml.reloadto true in the properties file will
give another extra
0.3 second to when loading a page (I copy this parameter from showcase and
suffered by it).

2, When you need to display a collection with a lot of items in it. Avoid to
using OGNL. For example:
There is a list in my page, which includes around 800+ items, I want to show
them in a select list. Previously I get it from database by Hibernate and
directly pass the result list to the component, this will cause 0.8-1 second
to finish construct this select component.
   
Then I loop the list in the java code first and convert it into a
Map, and pass the map to the select.
   
This will save 0.5 second to construct this select component on the page. If
you need to use a complex OGNL expression, it will be even slower, You can
loop a complex OGNL for 100+ times in the code comparing with normal java
code, then you will experience it :).
The OGNL is very convenience but it will impact the performance sliently.

3, . This tag will give another 500ms when load the page because it
needs to load the dojo script. This is nothing about the server side, the
cost is on the client side. You can save the page locally and open it by FF,
it is still slow(comparing without this tag). In most pages, this tag is
useless (unless you want to write your own ajax code under dojo framework).
I try to use my own code to replace it even I need some dojo functionality.

4, This article is very useful:
http://wiki.opensymphony.com/display/WW/Performance+Tuning. It is surely you
must copy out all the freemarker template into WEB_APP. Here I find out one
small thing:  after put alll the template to WEB_APP, you can also copy the
template/simple/hidden.ftl to template/xhtml/hidden.ftl because by default
hidden tag will use xhtml as theme, and this will allow the freemarker to
cache it properly.
BTW: I try to find out, but honestly can't experience different between
basic and default interceptor stack on performance in my project.

cheers:)

Regards,

Zheng Shuai


Re: [S2] The performance issue about OGNL

2007-02-27 Thread Shuai Zheng

Sorry to disturb again.

This issue is because default the s:hidden tag will use xhtml as theme, but
actually in the distribution, there is no template/xhtml/hidden.ftl. It
always get from template/simple/hidden.ftl. But the cache does not know it.
Then this template is recompiled again and again.

Will report it to JIRA.

A bad news for me, just know my target .net project response time is around
0.3 second. Any suggestion to improve the speed? If I use apache work with
tomcat or any web server, can I get faster speed?

Regards,

Zheng Shuai

On 2/27/07, Shuai Zheng <[EMAIL PROTECTED]> wrote:


One more thing, this only happens on template/xhtml/hidden.ftl.

Should I report this as a bug?

On 2/27/07, Shuai Zheng < [EMAIL PROTECTED]> wrote:
>
> Dear All,
>
> Still do research on the debug log and try to get performance
> improvement, because I try to beat another .net system on speed(it can shows
> all the pages in 0.5 second,sigh).
>
> One more thing I just find out, if the log does not cheat me:)
>
> Although I have enabled the property template_update_delay=6 in
> freemarker.properties and also move the template out the jar file.
> So there are a lot of log like:
> "[freemarker.cache]http-8080-Processor24
> template/xhtml/select.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
> using cached."
> So it looks correct. But also, there are something like followings:
>
> "Could not find template in cache, creating new one;
> id=[template/xhtml/hidden.ftl[en_GB,UTF-8,parsed]"
> "template/simple/hidden.ftl[en_GB,UTF-8,parsed] cached copy not yet
> stale; using cached."
> Above logs occur in the log again and again. I don't know what happened
> actually but it shows the hidden.ftl is not cached at all (how can this
> happens? when some others are cached?)
>
> Regards,
>
> Zheng Shuai
>
>
> On 2/26/07, Vlad2006 < [EMAIL PROTECTED]> wrote:
> >
> >
> > Hi Zheng,
> >
> > Have you profiled your application? Are you sure it is OGNL that makes
> > your
> > application slow?
> >
> > From my experience it is not so slow. At least I have not found it too
> > be a
> > bottleneck in my application. Not yet :-).
> >
> > What is really slow in WebWork/Struts2 is jsp tags like, textfield,
> > radio,
> > anchor, and other which are using FreeMarker templates.
> >
> > If it is your case, you could make it faster, you have to extract
> > templates
> > out of webwork.jar (in your case probably struts.jar) and put them in,
> > for
> > example, WEB-INF/templates directory.
> > There is a page on WebWork Wiki about it:
> > http://wiki.opensymphony.com/display/WW/Performance+Tuning
> >
> > I am not using Struts2 yet, but I believe most of the tips will work
> > for
> > Struts2.
> >
> > One more thing that could make application slower is when resource
> > bundles
> > are constantly reloaded. It is good for dev but not acceptable for
> > production. Check in struts property like: webwork.i18n.reload=false
> >
> >
> > Best regards
> > Vlad
> >
> >
> >
> > Shuai Zheng wrote:
> > >
> > > Dear All,
> > >
> > > I am using struts 2.0.6, but honestly the performance is very bad
> > (not
> > > need
> > > to think about scalability), to speed to load a simple page is much
> > slower
> > > than pure JSP (I haven't compared with struts 1). To refresh one
> > page it
> > > is
> > > 3-5 seconds with only one user. The profiler tells me the OGNL is
> > the
> > > bottleneck.
> > >
> > > I notice that there are some complains on OGNL about the performance
> > > already, may I know any other way to replace OGNL with anything else
> > to
> > > get
> > > a faster speed? Currently the speed is not acceptable for
> > production.
> > >
> > > Regards,
> > >
> > > Zheng Shuai
> > >
> > >
> >
> > --
> > View this message in context:
> > 
http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>



Re: [S2] The performance issue about OGNL

2007-02-27 Thread Shuai Zheng

One more thing, this only happens on template/xhtml/hidden.ftl.

Should I report this as a bug?

On 2/27/07, Shuai Zheng <[EMAIL PROTECTED]> wrote:


Dear All,

Still do research on the debug log and try to get performance improvement,
because I try to beat another .net system on speed(it can shows all the
pages in 0.5 second,sigh).

One more thing I just find out, if the log does not cheat me:)

Although I have enabled the property template_update_delay=6 in
freemarker.properties and also move the template out the jar file.
So there are a lot of log like:
"[freemarker.cache]http-8080-Processor24
template/xhtml/select.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
using cached."
So it looks correct. But also, there are something like followings:

"Could not find template in cache, creating new one;
id=[template/xhtml/hidden.ftl[en_GB,UTF-8,parsed]"
"template/simple/hidden.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
using cached."
Above logs occur in the log again and again. I don't know what happened
actually but it shows the hidden.ftl is not cached at all (how can this
happens? when some others are cached?)

Regards,

Zheng Shuai


On 2/26/07, Vlad2006 <[EMAIL PROTECTED]> wrote:
>
>
> Hi Zheng,
>
> Have you profiled your application? Are you sure it is OGNL that makes
> your
> application slow?
>
> From my experience it is not so slow. At least I have not found it too
> be a
> bottleneck in my application. Not yet :-).
>
> What is really slow in WebWork/Struts2 is jsp tags like, textfield,
> radio,
> anchor, and other which are using FreeMarker templates.
>
> If it is your case, you could make it faster, you have to extract
> templates
> out of webwork.jar (in your case probably struts.jar) and put them in,
> for
> example, WEB-INF/templates directory.
> There is a page on WebWork Wiki about it:
> http://wiki.opensymphony.com/display/WW/Performance+Tuning
>
> I am not using Struts2 yet, but I believe most of the tips will work for
> Struts2.
>
> One more thing that could make application slower is when resource
> bundles
> are constantly reloaded. It is good for dev but not acceptable for
> production. Check in struts property like: webwork.i18n.reload=false
>
>
> Best regards
> Vlad
>
>
>
> Shuai Zheng wrote:
> >
> > Dear All,
> >
> > I am using struts 2.0.6, but honestly the performance is very bad (not
> > need
> > to think about scalability), to speed to load a simple page is much
> slower
> > than pure JSP (I haven't compared with struts 1). To refresh one page
> it
> > is
> > 3-5 seconds with only one user. The profiler tells me the OGNL is the
> > bottleneck.
> >
> > I notice that there are some complains on OGNL about the performance
> > already, may I know any other way to replace OGNL with anything else
> to
> > get
> > a faster speed? Currently the speed is not acceptable for production.
> >
> > Regards,
> >
> > Zheng Shuai
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



Re: [S2] The performance issue about OGNL

2007-02-27 Thread Shuai Zheng

Dear All,

Still do research on the debug log and try to get performance improvement,
because I try to beat another .net system on speed(it can shows all the
pages in 0.5 second,sigh).

One more thing I just find out, if the log does not cheat me:)

Although I have enabled the property template_update_delay=6 in
freemarker.properties and also move the template out the jar file.
So there are a lot of log like:
"[freemarker.cache]http-8080-Processor24
template/xhtml/select.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
using cached."
So it looks correct. But also, there are something like followings:

"Could not find template in cache, creating new one;
id=[template/xhtml/hidden.ftl[en_GB,UTF-8,parsed]"
"template/simple/hidden.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
using cached."
Above logs occur in the log again and again. I don't know what happened
actually but it shows the hidden.ftl is not cached at all (how can this
happens? when some others are cached?)

Regards,

Zheng Shuai


On 2/26/07, Vlad2006 <[EMAIL PROTECTED]> wrote:



Hi Zheng,

Have you profiled your application? Are you sure it is OGNL that makes
your
application slow?

From my experience it is not so slow. At least I have not found it too be
a
bottleneck in my application. Not yet :-).

What is really slow in WebWork/Struts2 is jsp tags like, textfield, radio,
anchor, and other which are using FreeMarker templates.

If it is your case, you could make it faster, you have to extract
templates
out of webwork.jar (in your case probably struts.jar) and put them in, for
example, WEB-INF/templates directory.
There is a page on WebWork Wiki about it:
http://wiki.opensymphony.com/display/WW/Performance+Tuning

I am not using Struts2 yet, but I believe most of the tips will work for
Struts2.

One more thing that could make application slower is when resource bundles
are constantly reloaded. It is good for dev but not acceptable for
production. Check in struts property like: webwork.i18n.reload=false


Best regards
Vlad



Shuai Zheng wrote:
>
> Dear All,
>
> I am using struts 2.0.6, but honestly the performance is very bad (not
> need
> to think about scalability), to speed to load a simple page is much
slower
> than pure JSP (I haven't compared with struts 1). To refresh one page it
> is
> 3-5 seconds with only one user. The profiler tells me the OGNL is the
> bottleneck.
>
> I notice that there are some complains on OGNL about the performance
> already, may I know any other way to replace OGNL with anything else to
> get
> a faster speed? Currently the speed is not acceptable for production.
>
> Regards,
>
> Zheng Shuai
>
>

--
View this message in context:
http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [S2] The performance issue about OGNL

2007-02-27 Thread Shuai Zheng

Dear All,

Thanks very much for useful help.

Just fight with this for 24 hours and get some improvement.

I want to apology first because I am so stupid. Last evening I do a
profiling again. The OGNL is not the main bottleneck, but it is still a
problem.

My previous page loading is around 3-5 seconds. Now it is around 1-2
seconds.

First of all, when I saw Vlad's email, I copy out the template and delete
the original from struts-core.jar. It looks well (but I forget to compare
the timing, later i will do it again)

Then I rewrite the page again and enable the DEBUG in log4j to trace it.

Something what I found:
struts.configuration.xml.reload: this parameter in the properties file will
give another 0.3 second to loading time in my case (it is so bad, that I
think it should be mentioned in the document that this feature should be
disabled in production, because you know, in struts.properties of  showcase,
it is enabled.).

There is a list in my page, which includes around 800+ items, I want to show
them in a select list. Previously I get it from database by Hibernate and
directly pass it to the component, this will cause 1 second to finish
construct this select component.
   
Now I loop it in the class and convert it into a Map, then
pass the map to the select, it get around 1 second faster.

Regards,

Zheng Shuai

On 2/26/07, Vlad2006 <[EMAIL PROTECTED]> wrote:



Hi Zheng,

Have you profiled your application? Are you sure it is OGNL that makes
your
application slow?

From my experience it is not so slow. At least I have not found it too be
a
bottleneck in my application. Not yet :-).

What is really slow in WebWork/Struts2 is jsp tags like, textfield, radio,
anchor, and other which are using FreeMarker templates.

If it is your case, you could make it faster, you have to extract
templates
out of webwork.jar (in your case probably struts.jar) and put them in, for
example, WEB-INF/templates directory.
There is a page on WebWork Wiki about it:
http://wiki.opensymphony.com/display/WW/Performance+Tuning

I am not using Struts2 yet, but I believe most of the tips will work for
Struts2.

One more thing that could make application slower is when resource bundles
are constantly reloaded. It is good for dev but not acceptable for
production. Check in struts property like: webwork.i18n.reload=false


Best regards
Vlad



Shuai Zheng wrote:
>
> Dear All,
>
> I am using struts 2.0.6, but honestly the performance is very bad (not
> need
> to think about scalability), to speed to load a simple page is much
slower
> than pure JSP (I haven't compared with struts 1). To refresh one page it
> is
> 3-5 seconds with only one user. The profiler tells me the OGNL is the
> bottleneck.
>
> I notice that there are some complains on OGNL about the performance
> already, may I know any other way to replace OGNL with anything else to
> get
> a faster speed? Currently the speed is not acceptable for production.
>
> Regards,
>
> Zheng Shuai
>
>

--
View this message in context:
http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




The performance issue about OGNL

2007-02-25 Thread Shuai Zheng

Dear All,

I am using struts 2.0.6, but honestly the performance is very bad (not need
to think about scalability), to speed to load a simple page is much slower
than pure JSP (I haven't compared with struts 1). To refresh one page it is
3-5 seconds with only one user. The profiler tells me the OGNL is the
bottleneck.

I notice that there are some complains on OGNL about the performance
already, may I know any other way to replace OGNL with anything else to get
a faster speed? Currently the speed is not acceptable for production.

Regards,

Zheng Shuai


doubleCssClass of optiontransferselect does not works

2007-02-20 Thread Shuai Zheng

Dear all,

Just try to use doubleCssClass of  optiontransferselect, but it does not
work.

I am using 2.0.6 now.

Is it a bug?

Regards,

Zheng Shuai


Re: select - format date

2007-02-20 Thread Shuai Zheng

You can try this:

1, try to get a SimpleDateFormat instance from action or stack
2, use the OGNL syntax to format it:



This works for my case.

But I feel maybe it does not work for all the tags. You can try this
approach.

Regards,

Zheng Shuai

On 2/20/07, Bruno Melloni < [EMAIL PROTECTED]> wrote:


There probably is a better "struts" way of doing this, but here is one
way that gets the job done:

- Use a list of string-formatted datetimes.  Format the dates before
putting them on the list.

- For formatting, review the classes java.util.Date, java.util.Calendar,
java.text.DateFormat , java.text.SimpleDateFormat.  Use appropriately.

B.

-Original Message-
From: ros [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 20, 2007 5:32 AM
To: user@struts.apache.org
Subject: s:select - format date


Hi!

Using Struts2
 has
output:

2009-09-27 00:00:00.0 0.01
2009-09-27 00:00:00.0 null 

How to set dateTime (java.util.Date ) format? (e.g. to show only date)
How hide null values, if price is null?

Thanks!
--
View this message in context:
http://www.nabble.com/s%3Aselect---format-date-tf3259859.html#a9060019
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Ask for help when upgrade to 2.0.6

2007-02-20 Thread Shuai Zheng

Dear All,

I am trying to upgrade my project to 2.0.6.
I am using the default setting of struts 2.
There are always some errors occurs in DefaultWorkflowInterceptor (but some
of the pages no problem).

I do the debug, the code segment is here:

   if (action instanceof ValidationAware) {
   ValidationAware validationAwareAction = (ValidationAware)
action;

   if (validationAwareAction.hasErrors()) {
   if (_log.isDebugEnabled()) {
   _log.debug("Errors on action "+validationAwareAction+",
returning result name 'input'");
   }
   return inputResultName;
   }
   }

It always throws out exception so go to the inputResultName, but I don't
configure any validate method for it and my code works well in 2.0.1.

Is there anything I should take care?

Thanks very much!

Regards,

Zheng Shuai


Re: Spanish characters

2007-02-15 Thread Shuai Zheng

Juan is correct.

For myself, I just add the following line into every page:
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

And also, save all the page under UTF-8 mode. If you use Eclipse, you can
see the encode in file properties.

Regards,

Zheng Shuai

On 2/15/07, Juan Espinosa <[EMAIL PROTECTED]> wrote:


Dou you mean that i must put in every jsp page something like this

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>

Juan

-Mensaje original-
De: Christopher Schultz [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 15 de febrero de 2007 11:09
Para: Struts Users Mailing List
Asunto: Re: Spanish characters

-----BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Juan and Zheng,

Shuai Zheng wrote:
> Add the following line into your web.xml

It's only appropriate to use the CharacterEncodingFilter to force your
requests to be UTF-8 if all your pages are being /served/ in UTF-8.

Since you want to deal with "special" characters, you should set
everything
to UTF-8.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF1Glo9CaO5/Lv0PARAorUAKCAL0/IGrLHb6RtCTGx6CAvrlpJBgCgr6nS
rIFEqFCSlJW2sz7XzYJORr0=
=vk4l
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.17.39/687 - Release Date:
14/02/2007
16:17


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.17.39/687 - Release Date:
14/02/2007
16:17



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Spanish characters

2007-02-15 Thread Shuai Zheng

Add the following line into your web.xml


 SetCharacterEncoding
 org.springframework.web.filter.CharacterEncodingFilter

 
  encoding
  UTF-8
 



 SetCharacterEncoding
 *.jsp


 SetCharacterEncoding
 *.action


BTW: spring.jar must in your class path.

Regards,

Zheng Shuai

On 2/15/07, Juan Espinosa <[EMAIL PROTECTED]> wrote:



Hi, im having problems in my web application displaying spanish characters
Anyone knows what i have to configure to work this properly

For example if i put in a inputbox a Ñ character and submit that, then
when
the action
returns to the "input" it show  strange characters like ??? Or !!! in the
input box...

Thanks

Juan Espinosa

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.17.39/687 - Release Date:
14/02/2007
16:17



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [S2] Migrate from Struts 2.0.1 to 2.0.5

2007-02-14 Thread Shuai Zheng

You are welcome.
I want to say some more here:
1, if your project does not experience any bugs that has been reported for
2.0.1, it is not urgent to upgrade to another beta release.
2, if you need a demo to show to customer, I will suggest you to upgrade
because the 2.0.5 use new dojo version and it has some cool features. For
example, even there are some bugs reported for new datetimepicker tag, I
will still want to it.
3, Anyway, you should try the new version personally because it is the
direction but maybe not in the project. Our testing can help to let the GA
release comes earlier:)

Regards,

Zheng Shuai

On 2/14/07, walidito <[EMAIL PROTECTED]> wrote:



Thanks shuai for yoyr response,
I think I'd better wait for next releases (or for a GA release, if this
happens one day I hope).
thanks.


Shuai Zheng wrote:
>
> Based on my own experience, WW-1711 is a big issue.
> I know there is a way to walk around it, but I feel it makes the code
ugly
> and it is strange to put extra code there (select tag is popular and
shown
> all pages. Also it is strange that a string will be used as the value of
> select, in most of cases, a value of select will be integer, isn't it?).
>
> I am sad to hear that it will not be fixed in 2.0.6 and there is not
this
> issue in previous release. In my experience, a new bug comes with a new
> release should be easy to solve, but maybe I am not correct.
>
> Anyway, 2.0.5 is a good job. Based on my own experience, it is more
stable
> and faster than 2.0.1. For myself, the only reason I don't upgrade
because
> I
> don't want my team to change the code again and again.
>
> May I know when the GA release will come out? It looks like we need to
> wait
> another 2 weeks.
>
> When everytime a new release comes out(even still a beta), a new
> *-all.zipshould be released for downloading. This will attract more
> people to use it
> and this means more people will help to test it. As you see, there are
> lots
> of people, including me, don't want to use a jar which is compiled by
> ourselves (because we can't take too much risk in the project, using a
> beta
> version is already a risk, we can't afford more).
>
> Regards,
>
> Zheng Shuai
>
> On 2/14/07, Ted Husted <[EMAIL PROTECTED]> wrote:
>>
>> On 2/13/07, Shuai Zheng <[EMAIL PROTECTED]> wrote:
>> > I will suggest you to wait for the next release, because there are
>> really
>> > some critical bugs in the 2.0.5 (especially the bug on select tag).
>>
>> If you mean not being able to select non-string types, the only fix
>> we've had so far breaks a lot of the tests,
>>
>> * https://issues.apache.org/struts/browse/WW-1711
>>
>> so we haven't applied it to 2.0.6 yet (just the head, which is tagged
>> 2.1.x now).
>>
>> If you know of other critical issues, be sure that they have been
>> reported through JIRA for 2.0.6. If a problem isn't listed in JIRA,
>> then we don't know it exists :)
>>
>> -Ted.
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>

--
View this message in context:
http://www.nabble.com/Migrate-from-Struts-2.0.1-to-2.0.5-tf3221136.html#a8966503
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Migrate from Struts 2.0.1 to 2.0.5

2007-02-14 Thread Shuai Zheng

Based on my own experience, WW-1711 is a big issue.
I know there is a way to walk around it, but I feel it makes the code ugly
and it is strange to put extra code there (select tag is popular and shown
all pages. Also it is strange that a string will be used as the value of
select, in most of cases, a value of select will be integer, isn't it?).

I am sad to hear that it will not be fixed in 2.0.6 and there is not this
issue in previous release. In my experience, a new bug comes with a new
release should be easy to solve, but maybe I am not correct.

Anyway, 2.0.5 is a good job. Based on my own experience, it is more stable
and faster than 2.0.1. For myself, the only reason I don't upgrade because I
don't want my team to change the code again and again.

May I know when the GA release will come out? It looks like we need to wait
another 2 weeks.

When everytime a new release comes out(even still a beta), a new
*-all.zipshould be released for downloading. This will attract more
people to use it
and this means more people will help to test it. As you see, there are lots
of people, including me, don't want to use a jar which is compiled by
ourselves (because we can't take too much risk in the project, using a beta
version is already a risk, we can't afford more).

Regards,

Zheng Shuai

On 2/14/07, Ted Husted <[EMAIL PROTECTED]> wrote:


On 2/13/07, Shuai Zheng <[EMAIL PROTECTED]> wrote:
> I will suggest you to wait for the next release, because there are
really
> some critical bugs in the 2.0.5 (especially the bug on select tag).

If you mean not being able to select non-string types, the only fix
we've had so far breaks a lot of the tests,

* https://issues.apache.org/struts/browse/WW-1711

so we haven't applied it to 2.0.6 yet (just the head, which is tagged
2.1.x now).

If you know of other critical issues, be sure that they have been
reported through JIRA for 2.0.6. If a problem isn't listed in JIRA,
then we don't know it exists :)

-Ted.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Migrate from Struts 2.0.1 to 2.0.5

2007-02-13 Thread Shuai Zheng

I just try it last weekend.
The new feature in 2.0.5 is nice (mostly because now it is using new Dojo).

There are tips I have faced:
1, the datepicker has been replaced by datetimepicker
2, panel has been removed and replaced by div. And the refreshOnShow
attribute is ignored now.
3, a bug in select tag but there are some ways to walk round it.
Here issue 2 and 3 make me very uncomfortable, although I can change code to
walk around it, but it is unreasonable to be a solution for a project. So I
rollback to 2.0.1

You also need to change the struts.properties. You can refer to the new
showcase.

Please refer to the issues in JIRA which are posted for 2.0.5.

I will suggest you to wait for the next release, because there are really
some critical bugs in the 2.0.5(especially the bug on select tag).

For myself, I am waiting for the 2.0.6 and will try to upgrade the project
again.

Regards,

Zheng Shuai

On 2/13/07, walidito <[EMAIL PROTECTED]> wrote:



Hi,
I'm very sorry if this question has already been asked, but I would like
to
know how to migrate from 2.0.1 to 2.0.5 and if it is not risky.
I have already started my project in 2.0.1 and it works well (it took time
to make it work well)... I have few concerns about staying at 2.0.1 or
migrating :
1 - is it easy enough to migrate ?
2 - Will I need to change my code ?
3 - In the near future, I will definitely need to call Struts 1.x actions.
I
know there's a plugin system in the 2.0.5. But can I do it easily with
2.0.1
or should I better migrate to do so ?

Your answers are welcome !

thanks a lot.
--
View this message in context:
http://www.nabble.com/Migrate-from-Struts-2.0.1-to-2.0.5-tf3221136.html#a8945829
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




How to refreshOnShow in struts 2

2007-02-12 Thread Shuai Zheng

Dear All,

I have submitted an issue ww-1730 to JIRA (
https://issues.apache.org/struts/browse/WW-1730).

But I don't know whether there is a way to walk around it. It looks that
this will not be solved in next version 2.0.6.

I have several tabs in the page, each tab means a step of the process (but
they don't need to be seen in sequence). In the previous version, when I use
panel tag, it runs well, the remote tab will auto refresh. But in 2.0.5,
this tag has been removed and replaced by tag div :(.

Anybody can give me a hint on how to refresh the content when I click a tab.

Regards,

Zheng Shuai