[ANN] JavaPolis 2005 Quickie Monday 12th December 2005
Hi I know I should have said this much earlier than this, but I will be giving a 15 minute presentations on Struts and Beyond at JavaPolis 2005, Tomorrow. Please feel welcome to join me if you are attending. http://wiki.javapolis.com/confluence/display/JP05/JavaPolis+Quickies Now, hopefully this terrible cold, I have now, will go away and leave me alone! -- Peter Pilgrim __ _ _ _ / //__ // ___// ___/ + Serverside Java / /___/ // /__ / /__ + Struts / // ___// ___// ___/ + Expresso Committer __/ // /__ / /__ / /__ + Independent Contractor /___/////// + Intrinsic Motivation On Line Resume || \\=== `` http://www.xenonsoft.demon.co.uk/no-it-striker.html '' - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem with forms
HI, I have an action form, an action and a couple of jsp pages bound together in tiles. I'm trying to access a property of the action form from the jsp and get the following error generated: javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN at org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:240) The action can access the form bean fine. What do I need to do for the jsp to pick it up? chhum - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with forms
Does the JSP have a html:form tag in it that has the action attribute set to an action mapping that has the action form as the value of the 'name' parameter? Otherwise, what scope is the action form in? -Richard [EMAIL PROTECTED] wrote: HI, I have an action form, an action and a couple of jsp pages bound together in tiles. I'm trying to access a property of the action form from the jsp and get the following error generated: javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN at org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:240) The action can access the form bean fine. What do I need to do for the jsp to pick it up? chhum - 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]
Re: problem with forms
I think so I think so. I have this in the jsp html:form action=/core/surveys/data_match / this writes out as form name=dataMatchForm method=post action=/prpi/core/surveys/data_match.do/form In struts.config form-bean name=dataMatchForm type=com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchForm/ Action path is action path=/core/surveys/data_match type=com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchAction name=dataMatchForm scope=request validate=true input=/core/surveys/data_match/ Quoting Richard Yee [EMAIL PROTECTED]: Does the JSP have a html:form tag in it that has the action attribute set to an action mapping that has the action form as the value of the 'name' parameter? Otherwise, what scope is the action form in? -Richard [EMAIL PROTECTED] wrote: HI, I have an action form, an action and a couple of jsp pages bound together in tiles. I'm trying to access a property of the action form from the jsp and get the following error generated: javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN at org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:240) The action can access the form bean fine. What do I need to do for the jsp to pick it up? chhum - 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]
Re: problem with forms
Can you send the JSP code in which you are trying to access the bean? -R [EMAIL PROTECTED] wrote: I think so I think so. I have this in the jsp html:form action=/core/surveys/data_match / this writes out as form name=dataMatchForm method=post action=/prpi/core/surveys/data_match.do/form In struts.config form-bean name=dataMatchForm type=com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchForm/ Action path is action path=/core/surveys/data_match type=com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchAction name=dataMatchForm scope=request validate=true input=/core/surveys/data_match/ Quoting Richard Yee [EMAIL PROTECTED]: Does the JSP have a html:form tag in it that has the action attribute set to an action mapping that has the action form as the value of the 'name' parameter? Otherwise, what scope is the action form in? -Richard [EMAIL PROTECTED] wrote: HI, I have an action form, an action and a couple of jsp pages bound together in tiles. I'm trying to access a property of the action form from the jsp and get the following error generated: javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN at org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:240) The action can access the form bean fine. What do I need to do for the jsp to pick it up? chhum - 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]
Re: problem with forms
Sure html:form action=/core/surveys/data_match / div id=displayOptionsContainer h3Display Options/h3 div id=displayOptions table tr td class=fieldNameCompensation/td td colspan=2html:select property=data html:option value=basic_salaryBase Salary/html:option html:option value=total_cashTotal Cash/html:option html:option value=total_compTotal Compensation/html:option /html:select/td /tr The exception gets thrown on the html:select property but I assume this is just because its the first one Quoting Richard Yee [EMAIL PROTECTED]: Can you send the JSP code in which you are trying to access the bean? -R [EMAIL PROTECTED] wrote: I think so I think so. I have this in the jsp html:form action=/core/surveys/data_match / this writes out as form name=dataMatchForm method=post action=/prpi/core/surveys/data_match.do/form In struts.config form-bean name=dataMatchForm type=com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchForm/ Action path is action path=/core/surveys/data_match type=com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchAction name=dataMatchForm scope=request validate=true input=/core/surveys/data_match/ Quoting Richard Yee [EMAIL PROTECTED]: Does the JSP have a html:form tag in it that has the action attribute set to an action mapping that has the action form as the value of the 'name' parameter? Otherwise, what scope is the action form in? -Richard [EMAIL PROTECTED] wrote: HI, I have an action form, an action and a couple of jsp pages bound together in tiles. I'm trying to access a property of the action form from the jsp and get the following error generated: javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN at org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:240) The action can access the form bean fine. What do I need to do for the jsp to pick it up? chhum - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with forms
On 12/11/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I think so. I have this in the jsp html:form action=/core/surveys/data_match / this writes out as form name=dataMatchForm method=post action=/prpi/core/surveys/data_match.do/form An empty form? Try putting the html:select tag inside the html:form. The select tag will look to the enclosing form tag to find the form bean. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] obsfucating struts web application
Hey Erik... Just curious.. would you not have these problems at the inner layers too? Let us say ... I use Hibernate to persist my objects... since I would have to use xml mapping files between classes and database tables... I can not obfuscate my business/persistent objects as well in a straight forward fashion! May be the obfuscation tool need to look for string references as wellin the same way as an advanced refactoring IDE would do... or something like that to make our life simple! :-) ~raghu On 12/9/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have used KlassMaster on distributions that contain Struts classes before, and I took your approach as I recall. I didn't obfuscate Action classes, but there was nothing important in them anyway. Also, KlassMaster has a great scripting language for getting around the problems you mention, and it knows how to edit web.xml, etc. In my opinion, it is well worth the price ($400 for a single license last time I checked). Erik -Original Message- From: Raghu Kanchustambham [EMAIL PROTECTED] Sent: Dec 9, 2005 4:38 AM To: Struts Users Mailing List user@struts.apache.org Subject: Re: [OT] obsfucating struts web application Laurie.. are you sure this will work? Let us say i have a mapping that maps to a TelephoneAction in my strus-config.xml... the class name will get 'garbled' after obfuscation. When a hit is made, the struts runtime will look up the TelephoneAction class to forward the request and notices there is no class with that name anymore! Whether bytecode or sourcecode obfuscation, this problem will still persist! One solution: Use the option *not* to obfuscate classnames of action classes. But are we done? Not yet... what if we use dispatch action class? By similar logic, you should leave even your method names unobfuscated! So that isnt too good... One of my friends suggested one ways to obfuscate the action class names and methods.As a part of obfuscation process generate a file containing mappings from old names to new names. Then based on this generated file, you can write a script to work on config.xml to find and replace the unobfuscated names with those from the mappings file generated. Some amount of work, but I guess it should work. The other approach is not to obfuscate action class names and method names in them. Just do flow obfuscation on these action classes. Action classes by design would not have too much business code in them .. as they would be delegated to some business classes. Even if complex code (in terms of number of lines) does exist in them, flow obfuscation will make it difficult to read them. If they are fewer number of lines, then it may be easy to break flow obfuscation, but then in most cases the code would be so simple that it is OK that the hacker knows it ! ;-) Since rest of the classes (other than action classes) are obfuscated with out any constraints, you should be safe... at most your action classes would be broken into. May be .. you can treat your action classes like the DMZ (demilitarized zone). Dont know if some tools support all what has been written so far. If they do someone please let us know! :-) Regards, Raghu On 11/20/05, Laurie Harper [EMAIL PROTECTED] wrote: su mo wrote: Hi, I have STRUTS 1.2.7 based web application which I want to protect the decompilation of class files. I would like to obsfucate the code using JShrink or other obsfucating tools. I am wondering if anyone done this before to make the Struts 1.2.7based web application work with obsfucated class files. I want to mention that I am using Dispatch action with parameters attribute, so my method names and class names are clear text on the struts-config.xml A byte-code obfuscator should have no effect on the way a class runs. Unless you obfuscate at the source code level before compiling (which would cause all sorts of problems) you shouldn't need to worry about it. L. - 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]
Re: problem with forms
You have a trailing slash on the html:form, so the form element is closed right there and therefore not including the select. Try this instead: html:form action=/core/surveys/data_match div id=displayOptionsContainer ... /div /td/tr /table /html:form On 12/11/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Sure html:form action=/core/surveys/data_match / div id=displayOptionsContainer h3Display Options/h3 div id=displayOptions table tr td class=fieldNameCompensation/td td colspan=2html:select property=data html:option value=basic_salaryBase Salary/html:option html:option value=total_cashTotal Cash/html:option html:option value=total_compTotal Compensation/html:option /html:select/td /tr The exception gets thrown on the html:select property but I assume this is just because its the first one Quoting Richard Yee [EMAIL PROTECTED]: Can you send the JSP code in which you are trying to access the bean? -R [EMAIL PROTECTED] wrote: I think so I think so. I have this in the jsp html:form action=/core/surveys/data_match / this writes out as form name=dataMatchForm method=post action=/prpi/core/surveys/data_match.do/form In struts.config form-bean name=dataMatchForm type=com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchForm/ Action path is action path=/core/surveys/data_match type=com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchAction name=dataMatchForm scope=request validate=true input=/core/surveys/data_match/ Quoting Richard Yee [EMAIL PROTECTED]: Does the JSP have a html:form tag in it that has the action attribute set to an action mapping that has the action form as the value of the 'name' parameter? Otherwise, what scope is the action form in? -Richard [EMAIL PROTECTED] wrote: HI, I have an action form, an action and a couple of jsp pages bound together in tiles. I'm trying to access a property of the action form from the jsp and get the following error generated: javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN at org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:240) The action can access the form bean fine. What do I need to do for the jsp to pick it up? chhum - 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] - 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]
RE: IBM Portal server V5.0.2.3
No, that's nothing to do with struts not knowing about portlets. Portlet environment is set in IBM WSAD V5.1 still it opens in another window when deployed on the portal server. -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Laurie Harper Sent: Saturday, December 10, 2005 6:14 AM To: user@struts.apache.org Subject: Re: IBM Portal server V5.0.2.3 I suspect you may be running into problems resulting from the fact that Struts is written to the Servlet spec and knows nothing about Portlet environments. Try searching the archives and/or Google for 'Struts Portlet'. L. Meenakshi Singh wrote: yes I am using WSAD V5.1.1 using portal server. I have created the portlet have deployed it in the portal server. however, the href in one of the jsp's is not opening up in the same page where my portlet is showing. It opens up on a diff page. That is my problem. How do I make it open in the same page. That is how I am using the href element in my jsp: a href='%=response.encodeURL(request.getContextPath()+/jsp/CentralNoSearch.j sp)%' Search by Central Number/a Regards, Meenakshi. -Original Message- From: Mark Benussi [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 07, 2005 8:29 PM To: 'Struts Users Mailing List'; [EMAIL PROTECTED] Subject: RE: IBM Portal server V5.0.2.3 I think what you want is to create a Portlet. Use WebSphere Studio Application Developer to create a new Portlet Application and then install this with Portal Server. -Original Message- From: Meenakshi Singh [mailto:[EMAIL PROTECTED] Sent: 07 December 2005 11:39 To: Struts Users Mailing List (E-mail) Subject: IBM Portal server V5.0.2.3 hiee all, Please help if anyone has used the IBM portal server. I have a small struts app deployed on IBM Portal Server V 5.0.2.3 I add 2 jsps to the struts application. In one jsp I am putting a link with a href to point to another jsp. When I click on this link after deploying the portlet, it opens the link in the whole browser window which is not the same as the portal page. I want to open the link in the same portal page. Would anyone please tell me how I can do that? Thanks Regards, Meenakshi. - 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]
Re: Validator and Javascript
I dint understand how to copy the static javascript on the validator.xml to another .js file? Can u please elaborate? On 12/10/05, Laurie Harper [EMAIL PROTECTED] wrote: Tony Santinello wrote: Hi, I'm using Struts 1.2.7 and I'm using commons-validator to validate my forms. Can someone tell me why validator includes all the javascript functions when rendering the jsp page? Even including javascript functions that I'm not using in validation.xml, such as creditcard validation or integer validation? Is there anyway to include just the javascript my jsp needs and not all the extra javascript? There's two types of Javascript emitted by the validator framework: static and dynamic. The static script includes all the code that doesn't vary from form to form, whereas the dynamic stuff is dependent on the validations you've configured for the form. The html:javascript, by default, emits all the static code every time and generates additional dynamic code appropriate to the form. You can tell it not to emit the static Javascript at all (in which case you need to include it elsewhere on the page, directly or by reference), but you can't tell it to emit only a sub-set of the static code. Your best bet is to copy the static Javascript into a seperate .js file, include that in the head of your page, and turn it off in the html:javascript tag. Browser caching will then avoid the user having to download the static code everytime, which is one step better than inlining a sub-set of it. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:form dynamic action value
I have a html:form tag with a dynamic action value that works in one version of Struts and not in another. I'm new to Tiles and I want to do the following in one of the reusable tiles named report.jsp: html:form action=%= (String)request.getAttribute(action) % In an experiment, I took the struts-example webapp from the Struts 1.2.8 binary distributon and modified the html-link.jsp like this: % String actionValue = /html-link-submit; request.setAttribute(action, actionValue); % html:form action=%= (String)request.getAttribute(action) % This works so I go back to my application to do the same thing but doesn't work. I get the following error on the html page in the browser: [ServletException in:/tiles/report.jsp] null' I'm using a debugger and I can see that the action attribute is defined in the request context. Why the difference? Is it the struts environment? Both are running on Tomcat 5.0.28. My app uses Struts 1.1 and has this preamble in web.xml !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; The modified struts-example is from Struts 1.2.8 and has the same web.xml preamble as above. Would I be right in concluding that the difference is in the Struts version and that upgrading would solve my problem? My app has close to 100 pages, so before I start, can anybody offer some insight as to the root of the problem. Thanks. Perry Jeung - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validator and Javascript
Hi In your html:javascript tag set staticJavascript=false. This will remove all scripts except your validation. However you need to add a link to the generated scripts (in a .js file) in your .jsp. Hermod -Original Message- From: Deepa Khetan [mailto:[EMAIL PROTECTED] Sent: Monday, December 12, 2005 6:50 AM To: Struts Users Mailing List Subject: Re: Validator and Javascript I dint understand how to copy the static javascript on the validator.xml to another .js file? Can u please elaborate? On 12/10/05, Laurie Harper [EMAIL PROTECTED] wrote: Tony Santinello wrote: Hi, I'm using Struts 1.2.7 and I'm using commons-validator to validate my forms. Can someone tell me why validator includes all the javascript functions when rendering the jsp page? Even including javascript functions that I'm not using in validation.xml, such as creditcard validation or integer validation? Is there anyway to include just the javascript my jsp needs and not all the extra javascript? There's two types of Javascript emitted by the validator framework: static and dynamic. The static script includes all the code that doesn't vary from form to form, whereas the dynamic stuff is dependent on the validations you've configured for the form. The html:javascript, by default, emits all the static code every time and generates additional dynamic code appropriate to the form. You can tell it not to emit the static Javascript at all (in which case you need to include it elsewhere on the page, directly or by reference), but you can't tell it to emit only a sub-set of the static code. Your best bet is to copy the static Javascript into a seperate .js file, include that in the head of your page, and turn it off in the html:javascript tag. Browser caching will then avoid the user having to download the static code everytime, which is one step better than inlining a sub-set of it. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]