RE: Need documentation or code example for custom tag in Struts 2.3.24

2015-07-06 Thread Lynn Li
[mailto:lukaszlen...@apache.org] Sent: Tuesday, June 30, 2015 1:32 AM To: Struts Users Mailing List Subject: Re: Need documentation or code example for custom tag in Struts 2.3.24 2015-06-30 3:50 GMT+02:00 Lynn Li : > I am upgrading Struts from 2.1.6 to 2.3.24. My application has a custom URL > tag.

Need documentation or code example for custom tag in Struts 2.3.24

2015-06-29 Thread Lynn Li
I am upgrading Struts from 2.1.6 to 2.3.24. My application has a custom URL tag. I need help on refactoring custom URL tag code. Does anyone have documentation or code example for custom tag in Struts 2.3.24? Thank you in advance! Nothing in this message is intended to constitute an electronic

Re: Dynamically setting the template directory in an Action

2011-12-12 Thread Li Ying
I mean: If the OS is unix/linux, you can create file link (or folder link) on the file system. This doc describes more details: http://www.cyberciti.biz/faq/creating-hard-links-with-ln-command/ 2011/12/13 Gurcharan Singh : > Hi Li > > Sorry, not able to understand your point. Can y

Re: struts2 string to map conversion

2011-12-12 Thread Li Ying
What is your client side code (JSP)? In OGNL expression, a value assignment is something like: "aMap[aKey] = aValue" So, you need create HTML code like: On the server side, the OGNL expression will be converted into Java method invoking like: yourAction.getAMap().put("aKey", "aValue") Unfortun

Re: Dynamically setting the template directory in an Action

2011-12-12 Thread Li Ying
My suggestion: You can create a file(or folder) link on your file system. >From the view of your web app, it works like a file(or folder) inside the [document root directory], but the real file(or folder) is actually somewhere outside the [document root directory]. 2011/12/8 Gurcharan Singh : >

Re: How to compare string reference variables using ognl?

2011-12-12 Thread Li Ying
In OGNL, the "==" test will call the equals method, so, I believe the expression "#selectedOffer==#queryString" should work. Read the following document: http://commons.apache.org/ognl/language-guide.html In the sector [Operators], there is a table describe all the operators. If you think the tes

Re: struts2 annotation

2011-12-01 Thread Li Ying
I did some search, found it here: com.opensymphony.xwork2.conversion.impl.XWorkConverter.addConverterMapping(Map, Class) And this converter is configured in [struts-default.xml]: http://struts.apache.org/2.x/docs/struts-defaultxml.html The following doc describe more details: http://struts.apache

Re: Customizing validation

2011-11-28 Thread Li Ying
Yes, of course you are right. But what you talking about sounds like to change S2 mechanism itself, which we can not do. As a S2 user but not a S2 developer, the simplest way is to write a new validator.. Of course, If the [pre-condition based validation] is a common request, I think it will

Re: Please explain

2011-11-28 Thread Li Ying
This doc explains it. http://struts.apache.org/2.x/docs/interceptors.html#Interceptors-MethodFiltering 2011/11/29 Srineel Mazumdar : > Hi, > > Please explain the meaning of the following : > >  input,back,cancel,browse > - To u

Re: Customizing validation

2011-11-28 Thread Li Ying
Changing the [validation interceptor] will switch on/off the all validations by one pre-condition. But what he need is: if and only if pre-condition-A is true, run validation-A; if and only if pre-condition-B is true, run validation-B; etc... So, I think the right way is, change the validators.

Re: Customizing validation

2011-11-28 Thread Li Ying
be, adding some [pre-condition checking] into the Struts2 bundled validators themselves. But this is out of our control, hope the developers of Struts2 can here this. 2011/11/28 Jyothrilinga Rao : > Thanks Li Ying, > I got some information from > http://today.java.net/pub/a/today/2006/01/19

Re: Customizing validation

2011-11-27 Thread Li Ying
If your validate rules are fixed, only some parameters (integer/date format or something else) relies on the country setting, I suggest you implement it by retrieve the params via OGNL expression. The parameter for the Validators can be OGNL expression. These docs may help: http://struts.apache.or

Re: multiple header in struts2 select tag

2011-11-27 Thread Li Ying
u need upgrade to the latest version, and see if the error happen. 2011/11/28 Li Ying : > The error message is "optGroupInternalListUiBean.parameters is undefined" > I had a quick look at the source of Struts2 and tag template, > In [template/simple/optgroup.ftl]: > line

Re: multiple header in struts2 select tag

2011-11-27 Thread Li Ying
The error message is "optGroupInternalListUiBean.parameters is undefined" I had a quick look at the source of Struts2 and tag template, In [template/simple/optgroup.ftl]: line 23: <#if parameters.optGroupInternalListUiBeanList??>line 24: <#assign optGroupInternalListUiBeans=parameters.optGroupInter

Re: getText returns NULL when formating number using l10n

2011-11-27 Thread Li Ying
your actions, so you can use it in all the actions. 2011/11/23 Felipe Issa : > It's not a definitive solution, but it works. Thanks Li Ying! > > Em 21/11/2011 23:07, Li Ying escreveu: >> >> or you can do the null check in the jsp code, before you create the >>

Re: getText returns NULL when formating number using l10n

2011-11-21 Thread Li Ying
or you can do the null check in the jsp code, before you create the param list for the format string. Code like: 2011/11/22 Felipe Issa : > Hi. I'm trying to internationalize my application, and for that i need to > use the struts l10n. I have managed to parse the number according to the > us

Re: getText returns NULL when formating number using l10n

2011-11-21 Thread Li Ying
I have read the source of java.text.MessageFormat, looks like it output a "null" text to the result String when the argument is null. I think you can create a read-only property in your action (or your data model class), and implement the null check and format process in this property, code like:

Re: Dynamically setting the template directory in an Action

2011-11-20 Thread Li Ying
(1)I believe the word [template] in struts2 means, the template file to render a struts2 tag. for example, the file [struts2-core-2.2.3.jar]/template/xhtml/form.ftl is a template file to render the tag using theme "xhtml" (2)what you are trying to do, is to change the jsp file location which wi

Re: Struts Conventional plugin is not working, Not calling invoking my Action but page is displaying

2011-11-20 Thread Li Ying
Do you want to map your action to the following url? namespace: common action: homepage But your package configuration is: I think maybe this setting maps all the actions in this package to namespace "/", but not "common" as you want. Read the following documents, may help: http://struts.apach

Re: method's namespace

2011-11-20 Thread Li Ying
This document may help: http://struts.apache.org/2.x/docs/convention-plugin.html#ConventionPlugin-Actionannotation 2011/11/21 叶伟平 : > Dear All, > I have a action class which's namespace is "/"(Annotation), and, I > want to use another namespace for a method within the class. How to do > that? > >

Re: [S2] Displaying user entered values after failed type conversion while using getText()?

2011-11-17 Thread Li Ying
I have 2 suggestion: (A)Declare the input data field in your action as a String, instead of date or integer. So, the String field can hold anything input from client side. But this will be inconvenience to use, because you have to convert the string value to the date or integer value by yourself,

Re: Right way for exception handling

2011-11-17 Thread Li Ying
Hi, Ilya: > But struts-2 breaks this scheme. > > 1) it does not pass exception to container so container can't log it. I used struts2 for several years. In our projects, struts-2 does not break this schema. I have read the source of struts2. When an exception is thrown from action execution, str

Re: Message lookup (from key) in Test

2011-11-17 Thread Li Ying
Hi Miguel: How did you generate the error message? (A)Did you add the message key to the action errors, like: this.addActionError("error.authorisation"); (B)or did you retrieve the message text by the key, then add the text to the action errors, like: this.addActionError(this.getText("

Re: Struts 2 Initialization Plugin

2011-11-10 Thread Li Ying
I think lazy initialization is a simple choice, because it is not dependent on the J2EE container, this make your code easy to test. If you worry about duplicated-initialization triggered by multi request, the simple solution is, make your initialization code [synchronized], using reserved word [s

Re: s:text encoding issue

2011-10-19 Thread Li Ying
I tried the JSP code which you posted. It works fine. What is your [locale]? you said, you [select Arabic], do you mean [locale] is [Arabic]? What name is your property file, and what is the content in it? - To unsubscribe, e-m

Re: How to use tabbed panels with

2011-10-17 Thread Li Ying
JQuery UI can help you. Here is the home page: http://jqueryui.com/ Here is the tab ui demo: http://jqueryui.com/demos/tabs/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h..

Re: Unsubscribe from the group

2011-10-16 Thread Li Ying
Read the [ Unsubscribe ] section of this page: http://struts.apache.org/mail.html I believe you can do it by yourself. 2011/10/17 ashok ramasankar : > Hi, > > Please unsubscribe my mail id from the user group - user@struts.apache.org > Please do the needful. > > Thanks, > Ashok > --

Re: Struts 2 date field problem

2011-10-11 Thread Li Ying
Did your problem happens when date input or output? For output case, the tag can let you choose the format to use. See: http://struts.apache.org/2.x/docs/date.html For input case, Struts2 can convert HTTP parameters from String into most of data type you need, include Date. But for Date, it [us

Re: slow request/response may be because of validation/conversion

2011-10-10 Thread Li Ying
I think conversion and validation should not be turned off. The [conversion] convert http parameters (which is String) to the real data type so your action can accept. The [validation] check the parameters if they a valid. And also, normally, conversion and validation should not take too much ti

Re:

2011-10-08 Thread Li Ying
This page may help: http://www.ontola.com/en/javascript-onclick-return-false-does-not-work-in-i - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

Re: Accessing variable in View [S 1.3.8]

2011-10-03 Thread Li Ying
I took a quick look at Struts1 document. Looks like the following information can help: http://struts.apache.org/1.x/struts-taglib/tagreference.html#html:link = START = To specify a single parameter, use the paramId attribute to define the name of the request parameter to be subm

Re: Is it possible to redirect after a Stream result action has completed?

2011-09-24 Thread Li Ying
I guess you can not do this. Because there should be ONLY ONE HTTP response for every HTTP request. So you can only return a file downlod or a redirect to the client, but not both. If you want to jump to another page after file download, may be you can try JavaScript solution in the client side.

Re: Unicode Encoding request parameters

2011-09-24 Thread Li Ying
You don't need an extra-filter. The S2 default encoding is UTF-8. The code of S2 filter is: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter: public void doFilter(..) { .. prepare.setEncodingAndLocale(request, response); .. } and the code of PrepareOperations

Re: S2 Action Setter Not Called

2011-02-04 Thread li wei
the problem is that you pushed a HashMap on the ValueStack's root. if you do that, all the values will be populated to the HashMap, not your action class you can try this code to fix it. ActionContext.getContext().put("browser", userSession.getBrowser()); (2011/02/04 17:12), Rubens Gomes

Re: Problem with character encoding during redirect to another action

2011-01-26 Thread li wei
I think this is not a struts issue. are you using tomcat as your server? you can try to set URIEncoding of Connector to "utf-8" in server.xml (2011/01/26 23:45), Rafael Karbowski wrote: Hi @ all, I have a problem with the encoding of German umlauts. In the getter of the source action they a

Re: Calculate module of index in Struts2 iterator

2010-12-28 Thread Li Ying
That's just wired. The first idea in my head was, may be there is lacks of brackets in your expression. But then I checked the document of OGNL: http://www.opensymphony.com/ognl/html/LanguageGuide/apa.html Accordinting to this document, the operator [%] has higher precedence than operator [==].

Re: Creating Tabs in Struts 2

2010-12-28 Thread Li Ying
You can use the tag, as Maurizio Cucchiara has told you. http://struts.apache.org/2.2.1.1/docs/tabbedpanel.html Or you can use JQuery UI. Here are demos and docs: http://jqueryui.com/demos/tabs/ - To unsubscribe, e-mail: user-

Re: Error validating struts-2.0.dtd

2010-12-28 Thread Li Ying
May be something getting wrong in Eclipse IDE. Try: (1)Delete the whole project from Eclipse IDE. But NOT delete the project content from the file system (2)Import the project to Eclipse again (3)Clean the project And see if the error get cleared? -

Re: prompting me to download the jsp file

2010-12-28 Thread Li Ying
What HTML code does your tag render? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

Re: problem mapping values from the jsp to the action

2010-12-27 Thread li wei
can you show the generated html file? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

Re: Calculate module of index in Struts2 iterator

2010-12-21 Thread Li Ying
You can put the following debug code in your jsp: It may help you find out what the result of expression is. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apach

Re: cssClass attribute with <@s.textfield> ignored when inputError happens

2010-12-13 Thread Li Ying
I read the source of [simple/text.ftl], and found nothing looks like rendering the extra [class="inputError"] attribute. Can you tell me where it is? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional com

Re: cssClass attribute with <@s.textfield> ignored when inputError happens

2010-12-13 Thread Li Ying
I read the source code of [simple/css.ftl], it looks like trying to combine [cssClass] and [cssErrorClass]. So you can try: <@s.textfield name="port" value=port key="service.port" maxsize="5" cssClass="prop-port" cssErrorClass="inputError" /> see if the result is what you want?

Re: Struts 2.2.1 and Tag Lib oddities

2010-12-13 Thread Li Ying
I think the tag-lib [/struts-tags] is defined in [struts2-core-2.2.1.jar/META-INF/struts-tags.tld]. Can you see this file in your Eclipse, under the [Web App Libraries]? Or, can you see the [Web App Libraries] in the [Java Build Path => Libraries] of your web-app? Or, you can [refresh] your whol

Re: submit date in textfield with custom date format

2010-12-12 Thread Li Ying
Read this doc: http://struts.apache.org/2.2.1/docs/type-conversion.html From [# 3 Creating a Type Converter] to [# 6 Applying a Type Converter for an application] - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For a

Re: Bad Struts Day

2010-12-12 Thread Li Ying
Try: - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

Re: Invocation of type conversion manually

2010-12-12 Thread Li Ying
I think you don't need this bothering job. You can: (1)Define some properties in your base class of all your action classes. (2)Use these properties to capture data from the request. (3)Run your interceptor AFTER the interceptors of struts2. But BEFORE the execution of the Action class So, The i

Re: Problem using scriplet object in s:if tag

2010-12-12 Thread Li Ying
It don't works, because the JSP local variable is not an OGNL local variable. The JSP local variable will be translated into a local variable of the Servlet code, and it is a local variable of Java language, so you can not reference it in the OGNL expression. An OGNL local variable should be [put

Re: Iterator: field errors.

2010-12-12 Thread Li Ying
>> Since after validation fails the iterator grid also empty I think, you need separate the field names by list index -- since your data model is a list--, to indicate which [textfield] should be captured by which POJO element. And also, you need separate the field name of validation error, t

Re: Cancel in a form re: bypass Validation

2010-12-09 Thread Li Ying
I think Michal was right. If you don't want execute validation for some Action Method, the annotation "@SkipValidation" is a good solution. And, in your case, I noticed that, your server side action is doing nothing when the [cancel] button clicked. I suggest you can put a html Link for your [can

Re: Iterator: field errors.

2010-12-09 Thread Li Ying
What is the data type of objectList? How did you execute the validation, and how did you add the field error? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.o

Re: any option parameter for populating parameters to my bean?

2010-12-09 Thread Li Ying
Can you show us the entire Exception stack? I guess, this may be a type conversion error. According to this struts2 documents: http://struts.apache.org/2.x/docs/type-conversion.html#TypeConversion-BuiltinTypeConversionSupport "XWork will automatically handle the most common type conversion for y

Re: RE: RE: Result Type Stream Corrupted

2010-12-08 Thread Li Ying
Are the file size different? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

Re: Asking about BigDecimal in Struts 2

2010-12-07 Thread Li Ying
gt; >> 1,convert the munber into string in the jsp/view page. >> 2,write a JSTL to render that dataType by your self. >> >> Regards, >> Mead >> >> >> On Tue, Dec 7, 2010 at 10:25 AM, Yanto Bong wrote: >> >> > Hi Li, >> > >

Re: Problem in calling method from Struts.xml in struts2

2010-12-06 Thread Li Ying
BTW, according to the exception message: The execute method of UserRegistrationAction IS CALLED, but some code invoked by this method raised an exception. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additiona

Re: Problem in calling method from Struts.xml in struts2

2010-12-06 Thread Li Ying
It looks like, the latest class files were not deployed to the WebApp Context. Sometimes this happens. When you find something getting wrong, and your source code looks like right, Just try turn off the web app, and re-deployed your latest code again. See if it the error get fixed. Sometimes, th

Re: Bookmark and session

2010-12-06 Thread Li Ying
Do you mean, when user click some bookmark, you want to check if this bookmark belongs to this user? Basically, you can not control bookmark, because it is a browser operation. The only way i can tell is, to add a user id param to all your page url. So, when userA saved a bookmark, and when it cl

Re: submit date in textfield with custom date format

2010-12-06 Thread li wei
what is your locale associated with the request? if your locale's date format is defferent from "-MM-dd" , you have to customize the type conversion to make it work. http://struts.apache.org/2.2.1/docs/type-conversion.html -

Re: Asking about BigDecimal in Struts 2

2010-12-05 Thread Li Ying
This looks like the result of toString() of BigDecimal. May be you can try this: http://download.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html#toPlainString%28%29 2010/12/6 Yanto Bong : > Hi All, > > We've using BigDecimal as datatype in hibernate and model for Numeric (20,8) > da

Re: any ideas about handle user's relogin using interceptor?

2010-12-02 Thread Li Ying
It looks like so. 2010/12/3 maven apache : > Thanks! > > So the way I use the interceptor is right? > > Nothing have to be changed except saving the session id intead of sessin it > self? > - To unsubscribe, e-mail: user-unsubscr

Re: any ideas about handle user's relogin using interceptor?

2010-12-02 Thread Li Ying
I read your code, and noticed one thing. You saved the whole HttpSession instance in Map, this will waste memory. The information you really need is just the SessionID, but not the whole Session. SessionID can be retrieved from HttpSession.getId(); See: http://download.oracle.com/javaee/5/api/

Re: any ideas about handle user's relogin using interceptor?

2010-12-02 Thread Li Ying
The only data need to save is UserID and SessionID, I think it will not over 100 bytes per user. For 1000 user, the total memory will not over 10MB. So, you don't have to worry about memory problem. For the DB solution, if you worry about response speed. You can change the solution: Do not check

Re: Spring 3 Upgrade

2010-12-02 Thread Li Ying
I built a web app in this summer, using the latest Struts2.2.1 and the latest Spring3.x. And there was nothing going wrong. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@s

Re: any ideas about handle user's relogin using interceptor?

2010-12-02 Thread Li Ying
ActionContext is just a wrap class for convenience. If you need the real HttpSession. You should get the HttpRequest first, from ServletActionContext.getRequest(). See: http://struts.apache.org/2.2.1/struts2-core/apidocs/org/apache/struts2/ServletActionContext.html And then, you can get the Htt

Re: any ideas about handle user's relogin using interceptor?

2010-12-02 Thread Li Ying
The problem will be: (1)How to save the information about who is logged in from which session. and (2)How to check this information before every action execution For problem 1, if you only have one app server, you can save this information in global variable, if you need support multi app serv

Re: Calling Struts Action from JavaScript

2010-12-01 Thread Li Ying
OR, You can send a whole HTML code of the as response. In this case, your server side view will be simple, just like any normal JSP. The client side will receive the HTML code, and you can insert this HTML piece into your page. But it will be difficult to manipulate, because what you get is not

Re: Calling Struts Action from JavaScript

2010-12-01 Thread Li Ying
I recommend JSON when you need exchange complex data strut between client and server. Because it is very friendly to JavaScript, so you can easily handle complex data strut in your client side JavaScript code. Sample for JSON can be find in the web site Biesbrock has told you. The idea of JSON is

Re: Incorporating action interceptor configuration parameters into a message

2010-12-01 Thread Li Ying
e error message building part, add the maximumSize as a message format param. But it need many code, I don't think this issue is worth doing so may work. 2010/12/1 : > Thanks Li -- > > I saw what the interceptor was doing and decided that was not going to > work.  Would you mind p

Re: Calling Struts Action from JavaScript

2010-12-01 Thread Li Ying
2010/12/1 Anjib Mulepati : > Li > When you say sending response using JSON what does that mean? I mean, send a string in JSON format as response. If your response is simple, for example, just a "OK" or "ERROR" flag, you can use plain text. But when you need send a

Re: Incorporating action interceptor configuration parameters into a message

2010-11-30 Thread Li Ying
The source code of FileUploadInterceptor is: http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java .. if (maximumSize != null && maximumSize < file.length()) {

Re: Calling Struts Action from JavaScript

2010-11-30 Thread Li Ying
Chris is right. On the client side, there is not such a concept of "Struts Action".There is Server Side Resource only. You have to access(post or get) it by URL, param, and you must handle the response from the server side. Code should looks like: (1)Client side JavaScript Send a request to Se

Re: Calling OGNL static method with date argument issue

2010-11-30 Thread Li Ying
What is the error message? And, how did you defined the property "today"? Is it the same data type as the static method param? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h..

Re: binding paramters in struts2 without the form

2010-11-30 Thread Li Ying
> Struts will not automatically populate fields based on parameters passed via > the URL I always use URL to binding parameters to Action. And I have read source code of ParametersInterceptor, I think this Interceptor will populate all the params to Action. And it dose not treat params via URL o

Re: labelizing submit buttons

2010-11-30 Thread Li Ying
I think your tag has a leak of attribute "method" Your code: will generate HTML likes: When you click this button, there will be a http request parameter like "btn.search=Search". Struts2 will accept this parameter, and try to save it to your action property. So, there will be a property sett

Re: Upload file content to text box using struts 1.3.8

2010-11-29 Thread Li Ying
Another way is, using AJAX: (1)Send a file upload post, (using AJAX), to your FileUploadAction (2)FileUploadAction just read in the CSV file content, and return it as HTTP Response (3)On client side, AJAX can receive the Server response, then you can put it to the textarea (using JQuery) See: h

Re: Upload file content to text box using struts 1.3.8

2010-11-29 Thread Li Ying
Why do you need two forms? Can't you put the FileUpload and the textarea in one form? And in your Action, you can create 2 method, one handle the file upload, and the other one handle the other request - To unsubscribe, e-mail:

Re: Upload file content to text box using struts 1.3.8

2010-11-29 Thread Li Ying
(1)Select file from a [file input] (2)Upload it to your Action (by a post) (3)In your action, read in the CSV data, and store into some property(let's say CSVDataProperty) (4)Show your page again, and set the default value of the textarea by CSVDataProperty 2010/11/30 Anjib Mulepati : > Can anyo

Re: javax.servlet.ServletException: BeanUtils.populate

2010-11-27 Thread Li Ying
What happens when (1)liste is null or (2)liste is filled by null element or (3)index accessed is out of bound? 2010/11/27 Peter Nguyen : > Li, > > I think the issue is here is most likely point 3. When the form is submitted, > I suspect struts is trying to call getListe(int) t

Re: javax.servlet.ServletException: BeanUtils.populate

2010-11-27 Thread Li Ying
There will be only one class, which will be the class of the elements in the List. I just want to find the Constructor with the least parameters if there are more than one constructors for this class. Once I get the constructor, I can use it to create instance and append it to List automatically.

Re: javax.servlet.ServletException: BeanUtils.populate

2010-11-27 Thread Li Ying
mport java.util.ArrayList; import java.util.List; /** * A List class which can create items as need. * When method get(index) and add(index, element) is called, * and if there is no item in this index, item instances will be created * automatically to avoid a NullPointerException. * * @author Li

Re: javax.servlet.ServletException: BeanUtils.populate

2010-11-27 Thread Li Ying
I think the reason of the Exception maybe: (1)the data you post is named like "liste[0].nom" (2)Struts1 accept this http param, and try to translate it to a form property, by using a lib named Apache Commons BeanUtils See: http://commons.apache.org/beanutils/ (3)BeanUtils treats nested property

Re: File Download with multiple files. Design question

2010-11-20 Thread Li Ying
> Any examples of doing this in struts 2 You can get the HttpServletResponse by: ServletActionContext.getResponse() And then, you can set the download file name, by: response.setHeader("Content-Disposition", "attachment; filename=" + fileName); And then, you can get the Out

Re: File Download with multiple files. Design question

2010-11-19 Thread Li Ying
My suggestion: (1)I believe you can use ZipOutputStream to output the zipped data to the response OutputStream directly, instead of a temp file. So no temp file need to be created. OR (2)You can create a batch application, repeatedly run it with some interval (use cron or something). And in this

Re: struts2.1 validation problem! with "fileUploadStack"

2010-11-19 Thread Li Ying
Maybe you can add a property in your action which return the current date. And reference this property in your validation configuration. Or create a Static method in an Utility class, return return the current date, And reference this property in your validation configuration. If both of these do

Re: Databinding a checkboxlist

2010-11-19 Thread Li Ying
try 2010/11/19 Altenhof, David Aron : > Trying to figure out a way to do the following without much luck. > > I have an enumeration with a list of menu options and corresponding labels > such as: > > public enum Color { >        RED("Red"), >        BLUE("Blue"), >        GREEN("Green"); > >  

Re: Struts2, convention plugin, websphere 6.1

2010-11-18 Thread Li Ying
Everything submit from the client side, are passed as String. So you can't take object instance as your parameter. You need take the ids of these objects as parameter, and load object by the ids by you self. 2010/11/18 Harsh C : > I think that is probably what it was. Basically in my action, I

Re: Interceptor Stack config

2010-11-18 Thread Li Ying
Why you define "paramsPrepareParamsStack" again? I believe it is already defined in the default configuration file, you can just use it. 2010/11/18 RogerV : > > Hi > > I'm setting up a new Struts 2 project - the first time I've started from > scratch in ages. I think it must be age, but I seem

Re: OGNL map key reading

2010-11-18 Thread Li Ying
try: invoke the [get] method on map: or reference property on map: or iterator on values of map: or iterator on keys of map: - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands

Re: Interceptor Stack config

2010-11-18 Thread li wei
Hi RogerV I don't think config-browser plugin tells you which stack are you using, it just show you all of actions in namespaces you have configured, of course, including default namespace (2010/11/18 18:18), RogerV wrote: Hi I'm setting up a new Struts 2 project - the first time I've started

Re: Setting object from param tag fails in Struts 2.2.1

2010-11-17 Thread Li Ying
t;> >> The only other thing I can think of is that it's trying to set the cglib >> proxy object on the action class and is complaining about that. We are using >> cglib-nodep-2.2 to lazy load the KeywordList, and it worked perfectly fine >> in Struts 2.0. >> >

Re: Another stupid question re: Interceptors

2010-11-17 Thread Li Ying
I suggest you to do these things in the following way: (1)put 2 method in IdentifyAction. The first [execute] method returns [input], show the input page to user. (2)In the Identify-input.jsp, submit fields to [IdentifyAction] itself, but another method: [verify] (3)when validation fails, the r

Re: Setting object from param tag fails in Struts 2.2.1

2010-11-15 Thread Li Ying
"[Ljava.lang.String;" means a String array. Looks like you are trying to copy a List from one action to another. By somehow, struts2 is looking for a set method which take a String array as it's parameter. 2010/11/15 Raj Nagappan : > Hi, we recently upgraded from Struts 2.0.14 to 2.2.1 and I n

Re: Validation xml for Radio button

2010-11-15 Thread Li Ying
What data type of the property [yourAnswer] is ? If it is an int property, try delete the double-quotation surrounding the value 1. 2010/11/15 Prabhubalaji Ragavan : > Hi > I am using a radio option in my code. when i try to validate that thru the > validator.xml, the validation is not happenin

Re: Running external Javascript files through Struts/Freemarker -- access to ActionContext and ValueStack?

2010-11-12 Thread Li Ying
My suggestion: (1)Reference your js file as a static resource. (2)If the js need some dynamic information from your action. You can put js variables or hidden tags in your jsp, and retrieve these variables or hidden tags in your js. The js can be static outside resource, but [dynamic information

Re: Problem with Struts 1 form

2010-11-10 Thread Li Ying
> 3. No such value is set. So I guess it is taking default value right now. As I said, You may need change it to more than 200MB. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user

Re: Problem with Struts 1 form

2010-11-10 Thread Li Ying
(1)Is there any Proxy Server between the client PC and the Web App Server? (2)When the action going wrong, is there any Error or Exception message on the Server side? (3)There is a configuration item to control the max-file-size you can upload. You may need change it to more than 200MB. [maxFileS

Re: Missing message for key "welcome.title" in bundle "(default bundle)" for locale es

2010-11-10 Thread Li Ying
xample, if you defined: then you should reference them by: (4)I am not very sure, but I think the resource bundle name in struts-config.xml should be separated by dot instead of slash 2010/11/10 bladu : > > Hi Steven and Li, > > I have found out that my locale is [es]. But the p

Re: Missing message for key "welcome.title" in bundle "(default bundle)" for locale es

2010-11-09 Thread Li Ying
> try parameter="com/myapp/struts/MessageResources"/> This is right. The name of a resource bundle, should not include the locale suffix. Actually, a resource bundle, contains several resource files which have the same base name and different suffix for each locale. For more information, see: ht

Re: ONGL & EL expression problem.

2010-11-08 Thread Li Ying
>> Is there an unnecessary quotation mark after [titleID]? Try delete it and see if works. If it still not working, My suggestion is: (1)you can implement the search logic in the method [viewPage], and access the search result via a new property. or (2)use a Map instead of a List, so you ca

Re: How to use

2010-11-06 Thread Li Ying
The template of has these code: <#if !stack.findValue("#optiontransferselect_js_included")??><#t/> "> <#assign temporaryVariable = stack.setValue("#optiontransferselect_js_included", "true") /><#t/> These code should generate some HTML code which import the JS file. And, the JS

  1   2   3   >