Re: Incorrect test syntax

2010-09-24 Thread Li Ying
Hi Michael: I just readed the document of OGNL, it says that operator [==] will use the method [equals] to check if objects are equal. http://www.opensymphony.com/ognl/html/LanguageGuide/apa.html#operators My bad. Can you post the source code of the Action class (and the [config] class)? I thin

Re: Incorrect test syntax

2010-09-24 Thread Li Ying
Hi Michael: I think changing the return type from Enum to String is not a very good solution. It maybe make your JSP get work,but your Java code will become a little ugly. I think the better way is: (1)do not chang the return type of config.getProject(). (2)in tag , compare it to an enum constant

Re: Incorrect test syntax

2010-09-24 Thread Li Ying
Hi Michael: Or you can use another simple solution: Convert the value to String(by invoke the [toString] method), before you can compare it to the String constant. In your case, it should be: ... 2010/9/24 Li Ying > Hi Michael: > > I think changing the return type from Enum to

Re: Accessing User input in execute ( ) method

2010-09-27 Thread Li Ying
Hi hareendra : You don't need an ActionForm to capture the variables sent by client request. What you used to defined in ActionForm class, is now should be defined in Action class. You can read more detail information in http://struts.apache.org/2.2.1/docs/comparing-struts-1-and-2.html

Re: struts.xml parsing error, involving interceptor

2010-09-27 Thread Li Ying
Hi Ken: In the DTD file, it is defined: That means, you should add the definition of interceptor as children nodes of the [package] node. Hope these helps. 2010/9/28 Ken > > This has been driving me nuts... > > The following works in my code (typed by hand not copied from source): > >

Re: How to set the value of request scope in a interceptor and get it in jsp?

2010-10-07 Thread Li Ying
try 2010/10/7 > Hi, > > When I set a value in my interceptor,I could not get it in a jsp. > How to do that? > > > ### my interceptor > public class HogeIntercepter extends AbstractInterceptor { > > @Override > public String intercept(ActionInvocation invocation) throws Exception { >

Re: How to set the value of request scope in a interceptor and get it in jsp?

2010-10-07 Thread Li Ying
Hi lunch716: For more detail information about this issue, you can read these documents: http://struts.apache.org/2.2.1/docs/ognl.html http://struts.apache.org/2.2.1/docs/ognl-basics.html And in [ognl-basics.html], it says: "#request['foo'] or #request.foo" means "request attribute ['foo'

Re: If tag expression problem

2010-10-08 Thread Li Ying
I think there is a type mismatch too. Converting the array [pages] to strings should work, can you post your code, show us how you convert it? Or, you can try this: see if it works. 2010/10/8 Darren Karstens : > Hi, > I have the following code that displays a list of page numbers that > a

Re: If tag expression problem

2010-10-08 Thread Li Ying
variable [it] in the iteration. Code should like this: Java: XXXAction { private int page; public int getPage()... public void setPage(int page)... } JSP: 2010/10/8 Li Ying : > I think there is a type mismatch too. > > Converting the array [pages] to strings should wor

Re: How to create a costume struts2 tag? any demo?

2010-10-09 Thread Li Ying
Hi Lai: The error message looks like the value of the attribute [theme] (in your jsp) is invalid. Can you show us your jsp and TLD file? 2010/10/9 Mead Lai : > I read the attribute "name" in the template, the Exception log: > > Attribute theme invalid for tag hello according to TLD >         >

Re: How to create a costume struts2 tag? any demo?

2010-10-09 Thread Li Ying
attribute [theme], maybe you should extend your tag class from [UIBean] instead of [Component]. Which means, your class should like: public class Hello extends UIBean { ... ... } 2010/10/9 Li Ying : > Hi Lai: > > The error message looks like the value of the attribute [theme] (in >

Re: How to create a costume struts2 tag? any demo?

2010-10-09 Thread Li Ying
Hi Lai: I used to read the documents of Struts2, but mostly it can't answer my question. So i had to read the source, or debug it. For your question, i think you should read the source code of classes in package [org.apache.struts2.views.jsp.ui]. Get a look at the entire Class Hierarchy before

Re: How to create a costume struts2 tag? any demo?

2010-10-09 Thread Li Ying
Hi Lai: Of course you should extend your class from [BaseUI], so you can inherit the property [theme] in your class. But also, you should define the attribute [theme] (and all the other attributes you want to use) in you TLD file, or the jsp compiler can not recognize it in your jsp. You can rea

Re: Create Text Box Dynamically

2010-10-09 Thread Li Ying
Hi I think you can use tags looks like this: to generate 'n' text box dynamically. The html code should be: repeats 'n' times. When user input text in these text boxes and submit the form, the request should include several parameters which has the same name "data" and the different valu

Re: [S2] How to add a custom parameter to an existing Struts UI Tag?

2010-10-09 Thread Li Ying
Hi Burton: The error message looks like the TLD file does not defined the new attribute correctly. So i think maybe the execute environment is not using the modified TLD file but the old one. Can you show us how you do apply your TLD file to the execute environment? -

Re: sx:datetimepicker

2010-10-10 Thread Li Ying
Try delete the attribute [readonly="true"]. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

Re: sx:datetimepicker

2010-10-10 Thread Li Ying
I read the documents of JQuery Plugin. It looks like the attribute [showButtonPanel] means if show button panel [in the calender], but not if show a button beside the textfield. I think maybe you should use the attributes [showOn]/[buttonImage]/[buttonImageOnly]/[buttonText] instead. You can tak

Re: Master-details JSP with Validation xml

2010-10-12 Thread Li Ying
Hi cellterry: I think your problem is very general. What you need is a chance to reload some data, when the validation get failed and the page is displayed again. I think this document can help you: http://struts.apache.org/2.2.1/docs/inputconfig-annotation.html

Re: Master-details JSP with Validation xml

2010-10-12 Thread Li Ying
Another solution is: 1, Implement interface [ValidationWorkflowAware] in your Action class 2, In method [getInputResultName], you can load all the data you need, and then, return constant [INPUT] as the result name. Actually, In my application, I am using this solution in a little different w

Re: Master-details JSP with Validation xml

2010-10-12 Thread Li Ying
By the way, you can read source code of [com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor] to see how these 2 solutions get work. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands,

Re: Master-details JSP with Validation xml

2010-10-12 Thread Li Ying
Interface [Preparable] is another choice to implement the data loading logic. But, in some case, the data loading logic need to access the parameters value to know what data should be loaded. And, unfortunately, the interceptor [prepare] is configured before interceptor [params] in the default int

Re: Struts2 - Generate XML in an Action, then direct user to download .xml

2010-10-12 Thread Li Ying
You can generate your XML dynamically, and then write it to the response stream. If you set the response headers correctly, the browser should treat this response as a file downloading. Code in your action looks like this: public String execute() { String xmlStr = generateXML(); Http

Re: ognl and multdimensional lists

2010-10-13 Thread Li Ying
Hi Dave: What version of Struts are you using? A long time ago, i met the similar problem in Struts1. I thought the parameter named "cellCosts[0][4].quota" should be translated into java code likes: action.getCellCosts().get(0).get(4).setQuota(value); And the method [get] throws a IndexOutOfB

Re: referencing javascript files from (action) jsp file

2010-10-14 Thread Li Ying
I suggest you to reference your resource file(js, image, css and so on) in this way: /path/filename.js"> The [] part will render the contextPath where the web application is deployed. The [contextPath] is a property defined in Action: public String getContextPath() { ret

Re: referencing javascript files from (action) jsp file

2010-10-14 Thread Li Ying
Hi guys: looks like a better choice. I will try it in my project. Thanks~~~ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

Re: referencing javascript files from (action) jsp file

2010-10-15 Thread Li Ying
Hi Robert and Dave: I tried in my application, and it works for almost all the case. But there is one exception: In my application, i customized the CSS files shiped with Struts JQuery plugin and put them under path [{contextPath}/res/struts/]. In JSP, i need add code likes: to tell Struts

Re: referencing javascript files from (action) jsp file

2010-10-15 Thread Li Ying
[utils.js] is used for client side validation. it should be found in [struts2-core-2.2.1.jar/org/apache/struts2/static/utils.js] [styles.css] is used for Struts themes. it should be found in [struts2-core-2.2.1.jar/template/theme_name/styles.css] 2010/10/15 Guy Thomas : > Thank you, this work

Re: referencing javascript files from (action) jsp file

2010-10-15 Thread Li Ying
You can read this document: http://struts.apache.org/2.2.1/docs/static-content.html and check if your configuration is right. 2010/10/15 Guy Thomas : > Thank you, this works. I would like to draw your attention to possible > problems with the struts head tag. See below. > > > Domain Security

Re: give suggestion data display base on the Locale

2010-10-15 Thread Li Ying
You can call method [getText("activity.name")] to retrieve localized string. Read this document for more information: http://struts.apache.org/2.2.1/docs/localization.html 2010/10/15 singh123 : > > > >         >         > > > > listObject is a Linked list object. listValue and listIndex is

Re: referencing javascript files from (action) jsp file

2010-10-15 Thread Li Ying
Thanks a lot, I will try it. 2010/10/15 Robert Taylor : > Hi Li, > > JSTL and EL give you access to the implicit pageContext object. > From there you can access attributes from request and session. > > > For example: > > > And then use contextPath variable however you wish. > > I'm not sure how

Re: Struts, Spring, Hibernate and multiple Sessionfactories

2010-10-15 Thread Li Ying
We developed a multi-tenant app last year. But we didn't separate their data into different DB. Instead, we stored all data in one DB, and add a [tenant_id] column to all tables to distinguish which tenant it belong. I think this is a simpler solution. When you need to add new tenant, you can s

Re: Struts, Spring, Hibernate and multiple Sessionfactories

2010-10-15 Thread Li Ying
If you want to use multi-DB for multi-tenant (let's say tenant01 and tenant02) I think you can create config file should likes: and then, in your java code, you can get different bean instance for different tenant via [ID], code looks like: BeanFactory.getBean("sessionFactory_" + te

Re: Struts, Spring, Hibernate and multiple Sessionfactories

2010-10-15 Thread Li Ying
I think i don't understand what you want exactly. Can you tell me what you want to achieve? And what your code looks like? 2010/10/15 Eduard Neuwirt : > Hi Li, > > thanks for the answer. I didn't get how does it work within the > ? In this case ist the the question is how to access > to the app

Re: field value causing NumberFormatException and breaking Action

2010-10-15 Thread Li Ying
I suggest you to check what the parameters value actually are sent to server side. You can see this information via these tools: [Burp Proxy]: http://portswigger.net/burp/proxy.html OR [TCPMon]: http://ws.apache.org/commons/tcpmon/tcpmontutorial.html If the parameter value sent to server is not

Re: Character Encoding Error using new filters

2010-10-17 Thread Li Ying
I did a quick look at the struts2.2.1 source code. It looks like the method [HttpServletRequest.setCharacterEncoding] is invoked by class [FilterDispatcher] and [StrutsPrepareFilter]. (You can use [Call Hierarchy] view to find out this information) In your old configuration, [StrutsPrepareFilter]

Re: Character Encoding Error using new filters

2010-10-17 Thread Li Ying
Sorry, type error: > In your old configuration, [StrutsPrepareFilter] is the last filter applied > to request ==> Should be: In your old configuration, [FilterDispatcher] is the last filter applied to request 2010/10/18 Li Ying : > I did a quick look at the struts2.2.1 source

Re: field value causing NumberFormatException and breaking Action

2010-10-18 Thread Li Ying
I think it is [Parameters Interceptor]: http://struts.apache.org/2.2.1/docs/parameters-interceptor.html You can set a break point in the [setXXX] method of your Action class, then you can find out who is invoking it from the [Call Stack]. > One other question, do you guys know where the "writing

Re: field value causing NumberFormatException and breaking Action

2010-10-18 Thread Li Ying
I think it is perhaps a JBoss error. Because the parameters in ServletRequest should be immutable, that means Struts (or other frameworks) has no chance to change the Request parameters. See: http://download.oracle.com/javaee/5/api/javax/servlet/ServletRequest.html#getParameterMap%28%29 So the

Re: After upgrading from Struts 2.0.x to 2.2.x, static content no longer served...

2010-10-18 Thread Li Ying
Are your setting: ? Try delete it, use the default setting instead. I take a quick look of the struts source code. In [org.apache.struts2.dispatcher.mapper.DefaultActionMapper], it use the extension of request url to detect if this request should be mapped to an Action. If you set this consta

Re: After upgrading from Struts 2.0.x to 2.2.x, static content no longer served...

2010-10-18 Thread Li Ying
By the way, if you DO want to set the extension of action to "", try: See if it works. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

Re: Overriding Templates

2010-10-18 Thread Li Ying
Hi adam: what theme are you using? The default theme in Struts2.2.1 is [xhtml]. Maybe you need change the default theme or the theme of your tag to [simple]. Can you show us your setting file(struts.xml and so on) and your jsp code? 2010/10/19 adam pinder : > > > > I have just upgraded struts

Re: Overriding Templates

2010-10-19 Thread Li Ying
With a lot of debugging, I think i have found what's wrong. If you use the default setting, In method [createTemplateLoader] of class [org.apache.struts2.views.freemarker.FreemarkerManager], Struts will create 3 TemplateLoader which is: 1,ClassTemplateLoader, which will load Template from class u

Re: Can't deploy on server

2010-10-19 Thread Li Ying
It looks like: 1, Oracle's XML parser is chosen to parse your xml configuration file. 2, And it failed. (Don't know why and don't interest to know) You can try to delete Oracle's XML parser and use another one. See this page: https://issues.apache.org/activemq/browse/SM-169 for more information.

Re: Master-details JSP with Validation xml

2010-10-19 Thread Li Ying
#x27;t have to change the interceptor stack, this make it easier to upgrade to a new version of Struts in the future. 2010/10/13 Dave Newton : > On Wed, Oct 13, 2010 at 12:44 AM, Li Ying wrote: > >> But, in some case, the data loading logic need to access the >> parameters value

Re: Overriding Templates

2010-10-19 Thread Li Ying
Hi Maurizio: In this document: http://struts.apache.org/2.2.1/docs/template-loading.html It says the template should be searched in (in this order): 1, web app folder 2, class path But i have read the Struts2.2.1 source code, it creates TemplateLoader in a different order, as i described in my e

Re: Overriding Templates

2010-10-20 Thread Li Ying
> Just add this to your web.xml: > >     >        templatePath >        template >     The param [templatePath] can start with only "class://" or "file://". Otherwise, struts will ignore it and do not create a TemplateLoader for it. (See method [init] and [createTemplateLoader] of class [org.apac

Re: [S2] 2.2.1 possible freemarker template bug

2010-10-20 Thread Li Ying
With a lot of debugging, I think i have found what's wrong. If you use the default setting, In method [createTemplateLoader] of class [org.apache.struts2.views.freemarker.FreemarkerManager], Struts will create 3 TemplateLoader which is: 1,ClassTemplateLoader, which will load Template from class

Re: Overriding Templates

2010-10-20 Thread Li Ying
a BUG of Struts2, because this behavior is different from the Struts2 document. And, as adam said, it also different from the old version of Struts2. 2010/10/20 Dave Newton : > So you're saying it doesn't work for him? > > Dave > > On Wed, Oct 20, 2

Re: Overriding Templates

2010-10-20 Thread Li Ying
If I am the author of this code, i think the priority order of these 3 TemplateLoaders should be: 1, WebappTemplateLoader 2,ClassTemplateLoader (when value of param [templatePath] is string starts with "class://") or FileTemplateLoader(when value of param [templatePath] is string starts with "file:

Re: Overriding Templates

2010-10-20 Thread Li Ying
Actually I did not know about these, Sorry. And (A)I am just a new guy of Struts2 community, if I put some message into the Struts2 docs and it is not right, I will mislead so many users, I will feel so~~~ sorry. (B)As you can see, my English is not good. 2010/10/20 Dave Newton : > You know

Re: Overriding Templates

2010-10-20 Thread Li Ying
OK, I will do it, But maybe tomorrow, because the local time is over 11PM now. 2010/10/20 Dave Newton : >> (A)I am just a new guy of Struts2 community, if I put some message >> into the Struts2 docs and it is not right, I will mislead so many >> users, I will feel so~~~ sorry. > > Honestly, I'd

Re: Can't deploy on server

2010-10-20 Thread Li Ying
Are you using OC4J? These pages may help: http://forums.oracle.com/forums/thread.jspa?threadID=363566 http://forums.oracle.com/forums/thread.jspa?forumID=46&messageID=726074&threadID=248962 http://forums.oracle.com/forums/thread.jspa?threadID=367999&tstart=0 --

Re: Can't deploy on server

2010-10-20 Thread Li Ying
> Thanks for your answers, i try put next code into web.xml file: > > javax.xml.parsers.DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/> > javax.xml.parsers.SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl"/> > > javax.xml.transform.TransformerFactory="

Re: Overriding Templates

2010-10-21 Thread Li Ying
I have reported it to JIRA as a BUG. https://issues.apache.org/jira/browse/WW-3522 If the develop team confirm that it really is a bug, then I will add information to the docs. - To unsubscribe, e-mail: user-unsubscr...@struts.ap

Re: This absolute uri (http://displaytag.sf.net) cannot be resolved in either web.xml or the jar files deployed with this application

2010-10-21 Thread Li Ying
Are your referencing your tag in jsp by code likes: <%@ taglib prefix="display" uri="http://displaytag.sf.net"; %> I am not sure, but maybe in the old version of JSP specification, you need add this to your web.xml: http://displaytag.sf.net /WEB-INF/tlds/displaytag.tld to tell the ap

Re: RequestHeaderAware in Struts 2?

2010-10-26 Thread Li Ying
What Chris has said is right. But what Jose Luis asked for is a inject mechanism likes ParameterAware which takes all the request params through one Map, but not through several property. So I think the simpler (also more Quick And Dirty) way is: (1)Create a interface, likes: public interface He

Re: checkbox problem

2010-10-26 Thread Li Ying
My way to solve this kind of problem: (1) Use a DTO class as the data modal for columns of each row. Every column is represented by one property of the DTO class. For example: public class Info { private boolean use; private String name; private int id; // getter

Re: checkbox problem

2010-10-26 Thread Li Ying
I mean: Representing associated data by a DTO class and then holding DTO instances in one List is better than Holding data in several separated Lists each represent one column. 2010/10/26 Dave Newton : > On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote: >> I think this is a bett

Re: checkbox problem

2010-10-26 Thread Li Ying
Actually, I have tested these sample codes before I sent it to you, and it worked very well. If it not working on your environment, maybe something else is getting wrong. Does any exception message appeared? 2010/10/27 Peter Bliznak : > Thanks for your time but what you show me is exactly what I

Re: checkbox problem

2010-10-26 Thread Li Ying
I think so. In the final, if you want to submit any data to member of a list, the [name] of the HTML element should be something like: "listName[indexNumber].propertyName" Or strust2 can not know where this parameter should be applied to. If your code can work, the first thing should check is: If

Re: RequestHeaderAware in Struts 2?

2010-10-27 Thread Li Ying
I would implement this function as a Utility Class, and call it from the Action class. In the Utility Class you can get the HttpServletRequest instance by [ServletActionContext.getRequest()]. In this case, you even don't need RequestHeaderInterceptor to inject Headers into your action, because th

Re: Reg: Issue with Struts 2 Data Binding

2010-10-27 Thread Li Ying
Your data is declared as HashMap So Struts2 don't know what data type the parameter should be converted to. My suggestion: Change your Action class likes: Public Class ActionClass{ private *HashMap* userPropsAsDate; private *HashMap* userPropsAsInt; private *HashMap* userPropsAsStr; // Setter

Re: Reg: Issue with Struts 2 Data Binding

2010-10-27 Thread Li Ying
May be you can copy all the properties from a map to an instance of your model class. You can implement this by (1)[BeanUtils.populate] of Apache Commons BeanUtils See: http://commons.apache.org/beanutils/apidocs/org/apache/commons/beanutils/BeanUtils.html#populate%28java.lang.Object,%20java.util.

Re: Get s:url in action

2010-10-27 Thread Li Ying
Not sure which part of this misson is bothering you. Basically, you need: (1)Get the context path of your web app, by invoking [ServletContext.getContextPath()] (2)Build the relative path (3)Build the query parameters what you want And then combine all of them. Most time you can implement this b

Re: The requested list key 'prices' could not be resolved as a collection/array/map/enumeration/iterator type.

2010-10-28 Thread Li Ying
Did you create the list which is referenced in your JSP? 2010/10/28 cellterry : > > Hello all, > > I encountered a strange problem today: > > so.detail.jsp: > … > > … >                                                        key="price" list="prices" listKey="id" > listValue="price" >          

Re: The requested list key 'prices' could not be resolved as a collection/array/map/enumeration/iterator type.

2010-10-28 Thread Li Ying
I need see all your code before I can find what's going wrong. Can you show me the whole Action class and JSP? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.

Re: The requested list key 'prices' could not be resolved as a collection/array/map/enumeration/iterator type.

2010-10-28 Thread Li Ying
You may need check: (1)Which jsp pages is executed when you submit your page? (2)Before the tag reference the list which named "prices", are you sure you have created it? Because I find the "prices" is created in only one if-else branches.

Re: Struts 2 s:action tag doesn't render action errors if any are present

2010-10-28 Thread Li Ying
> 2. What I liked about having an action for rendering the controls it's that I > can reuse them across different JSP pages.  What other alternatives do you > suggest me that can achieve the same level of modularity? Try or . You can create a common jsp, and include it in different pages. Ac

Re: s:textfield or s:select with button

2010-10-31 Thread Li Ying
Try put them in same row of a table: 2010/11/1 cellterry : > > Dear all, > > I have a question about s:textfield or s:select with a command button just > following it. > > For example, I have tried this: > > > > > I found that the button "..." is not following the

Re: Multiple form pages - best practise?

2010-10-31 Thread Li Ying
I think the simpler way is: (1)Implement all your inputs in one Action and one JSP (2)Control the visibility of your inputs via JQuery In your case, you can put your inputs in 3 divs(or something else), and bind click event handler to the buttons. In the handler function, you can call [show] to d

Re: struts2 html redering problem

2010-11-03 Thread Li Ying
You mean you want to print a message which include HTML Code? Try 2010/11/3 m.harig : > > hello , > >       am doing a application in struts2.2.1 , in which am adding some html > values in my setter method , like Home Loan Transfer , > when i print this values in jsp page by > , but i

Re: UpDownSelect & JPA

2010-11-04 Thread Li Ying
The struts2 document says: [The tag will pre-select multiple values if the values are passed as an Array or a Collection(of appropriate types) via the value attribute] see: http://struts.apache.org/2.2.1/docs/updownselect.html So maybe you need define the property in your action as an Array. Befo

Re: how does the namespace work in struts

2010-11-05 Thread Li Ying
>> Are you rendering html code by your self? Don't do this. Try Struts2's tag lib instead. Example: The tag lib will convert the namespace/action to a valid URL for you. And then,when you submit this form, on the server side, struts2 will map your request URL to an action. See: http://strut

Re: how does the namespace work in struts

2010-11-05 Thread Li Ying
>> This HTML code, will post your form to the RELATIVE path [space/register]. So, the ABSOLUTE path which is requested will depend on the current URL of this page. If ABSOLUTE path is not right, no doubt struts2 can not map it to a right namespace/action. >> I will get a 404 error if I set t

Re: Have you ever used InputConfig annotation?

2010-11-06 Thread Li Ying
Actually, I am using interface [ValidationWorkflowAware] instead of annotation [InputConfig] for the purpose of repopulation when input validation fail happen. You can see how ValidationWorkflowAware work when you read the source code of DefaultWorkflowInterceptor. Basically, the idea is similar.

Re: How to use

2010-11-06 Thread Li Ying
>> if I click the button to move the items, it doesn't work. Does any javascript error show up? Can you show us your entire source code? 2010/11/6 Mead Lai : > Hi All, > > I am now using tag with simple theme. > It shows two select-list fine, but if I click the button to move the items, > it d

Re: How to pass date from action to custom jsp tag?

2010-11-06 Thread Li Ying
The value passed to tag attribute is a simple String. You have to EVALUATE IT as a expression to get the real value. You can read the source of Struts2 tag lib to study how they evaluate the expression. For example: in class [org.apache.struts2.components.Property] (This class is invoked by tag )

Re: How to use

2010-11-06 Thread Li Ying
"no object found" looks like some javascript is running, but it could not found an object in the HTML DOM. so, it looks like not an error of javascript file, but an error of your HTML DOM. For example, ID of some element is missed. Again, I need read the entire source code before I can tell what i

Re: How to use

2010-11-06 Thread Li Ying
> list="{'spring','hibernate'}" doubleName=""> Looks like you missed the attribute [name] - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

Re: How to use

2010-11-06 Thread Li Ying
ag, and the s: > head tag needs to be there. > > Dave >  On Nov 6, 2010 2:59 AM, "Li Ying" wrote: >>> >> list="{'spring','hibernate'}" doubleName=""> >> >> >> Looks like you missed the attribute [nam

Re: How to use

2010-11-06 Thread Li Ying
Sorry, type error: "The is nothing ..." should be "There is nothing ..." - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

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

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: 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: Missing message for key "welcome.title" in bundle "(default bundle)" for locale es

2010-11-10 Thread Li Ying
I think there are several problem (1)You have defined the same message key in different resource bundle (ApplicationResource and MessageResources). This may be not a good way to maintenance resource (2) is not very good. The resource bundle should be reference by base name, and the suffix will be

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: 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: 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: 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: 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: 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-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: 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 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: 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: 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.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: 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: 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: 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

  1   2   >