Jakarta struts and validation
I have a working validatorform form that uses the struts validation framework (mostly handled through xml files).
but i want it to instead of just saying "email is invalid"... i want it to also highlight the text infront of the field in red. any ideas as to the best way to implement this?
My code can be seen at this experts exchange thread: http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_21078788.html
THANKS!
The field label? If you have it in a tag (say, an inline DIV or SPAN), and it has an ID, you can get a reference using Javascript and modify the foreground color. That's some Javascript and CSS stuff.
Tying this into Struts is a different issue... you'd have to do something to the Javascript that Struts uses to validate those values.
Similar Messages
-
Struts and validation question ?
hi,
i am using the struts framework for my application, i have a simple jsp logon page (username, password)
i have defined a validtion.xml file
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
<!--
Validation Rules for the Struts Example Web Application
$Id: validation.xml,v 1.8 2003/05/25 22:51:20 dgraham Exp $
-->
<form-validation>
<!-- ========== Default Language Form Definitions ===================== -->
<formset>
<form name="logonForm">
<field property="username"
depends="required, minlength,maxlength">
<arg0 key="prompt.username"/>
<arg1 key="${var:minlength}" name="minlength"
resource="false"/>
<arg2 key="${var:maxlength}" name="maxlength"
resource="false"/>
<var>
<var-name>maxlength</var-name>
<var-value>16</var-value>
</var>
<var>
<var-name>minlength</var-name>
<var-value>3</var-value>
</var>
</field>
<field property="password"
depends="required, minlength,maxlength">
<arg0 key="prompt.password"/>
<arg1 key="${var:minlength}" name="minlength"
resource="false"/>
<arg2 key="${var:maxlength}" name="maxlength"
resource="false"/>
<var>
<var-name>maxlength</var-name>
<var-value>16</var-value>
</var>
<var>
<var-name>minlength</var-name>
<var-value>3</var-value>
</var>
</field>
</form>
<form name="registrationForm">
<field property="fromAddress"
depends="required,email">
<arg0 key="prompt.fromAddress"/>
</field>
<field property="fullName"
depends="required">
<arg0 key="prompt.fullName"/>
</field>
<field property="replyToAddress"
depends="email">
<arg0 key="prompt.replyToAddress"/>
</field>
<field property="username"
depends="required">
<arg0 key="prompt.username"/>
</field>
</form>
</formset>
</form-validation>i have also the validation-rules.xml file provided by the struts lib.
i would like to force the content of 'username' property to be alphabetic.
i guess i have to create my own element
<validator name="alphabeticString"...> inside the validation-rules.xml file, but i am newbie in javascript programming.
i have tree question.
1) why the validation code inside the validator element is written in javascript since it's not going to be executed at client side???
2)can i use java instead ? (to code teh validation ...)
3)has anyone got a code to solve this problem ?
thanks for your helpi would like to force the content of 'username' property to be alphabetic.
i guess i have to create my own element
<validator name="alphabeticString"...> inside the validation-rules.xml file,
but i am newbie in javascript programming.Not for something that simple... there's a validator rule called mask, which takes a regular expression as an argument, so if you want only a-z: "[a-zA-Z]*" should work.
1) why the validation code inside the validator element is written in javascript since it's not going to be executed at client side???It is validated on the client, or can be. You have to include the javascript with the html:javascript tag library tag and specify the form name. Then you need to put the onsubmit="return validateFormName();" attribute in the form tag. If JS isn't supported, it'll still default back to the server side validation.
2)can i use java instead ? (to code teh validation ...)Don't include the JS stuff. -
Can Struts and JSF coexist?
I have a Struts based application and now I want to build an additional module on top of that using pure JSF. My question is, can Struts and JSF co-exist in the same application? If yes, what are the cons of that approach? What are the places I need to tweak in the configuration files so that they work together?
thanks,Hi,
Yes they can coexist. Actually that's the approach recommended by Craig McClanahan. I have developed a full enterprise application (80% completed) which uses JSF in front and Struts in the back using Struts-Faces integration library (developed by Apache).
So far I haven't faced any major issues with this approach. However, I haven't try using Struts validator on JSF objects.
Read the article below on how to integrate JSF w/ Struts.
http://www.oracle.com/technology/pub/articles/masterj2ee/j2ee_wk8.html -
Hello. We have had a TAR going for some time regarding an issue with Struts and ADF in Portal. This is the summary of the TAR:
Customer followed the following document to create his Struts ADF application:
Developing an End-to-End Web Application Using the Default Technology Scope
at
http://www.oracle.com/technology/obe/obe9051jdev/ADFtoJSP/defaultendtoend.htm
After following the steps in the documentation, his application worked just fine.
- After this he decided to portletize his application using the following document:
OracleAS Portal Developer Kit (PDK)
How to create a Struts Portlet ?
at
http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/ARTICLES/pdkstruts/portletize-your-app.html
When adding his portlet to a page, he basically received a portlet without any data, while the same worked fine outsi
de of Portal.
These are examples from the JSP file that do not show up in the portlet:
<c:out value="${bindings.DepartmentsView1.labels['DepartmentId']}">
<c:out value="${bindings.DepartmentId.label}"/>
</c:out>
We figured out that if we add the following filter mapping then it works fine:
<filter-mapping>
<filter-name>ADFBindingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
This filter mapping would mean that it maps all URLs to the ADFBindingFilter. I suppose this would not be necessary and we're concerned about the implications this might cause and we believe that there should be a better solution for this.
The final reply from support was that Portal is not yet supported with ADF technology. Does anyone have any comment on the above filter issue and other thoughts on using Struts and ADF in Portal? Another issue we found was that the PDK Struts tags do not support EL expressions. Have a look at this forum post:
Re: Struts and nested tags in parameters. Possible?I am trying to create a portlet with JSF/ADF
I Developed a Application with Oracle ADF UIX from: http://www.oracle.com/technology/obe/obe_as_1012/j2ee/develop/client/uix/lesson_uix.htm
and then I followed this link: http://oracle001.cedecra.it/pdk/articles/pdkstruts/portletize-your-app.html
to portletize the application
and I am getting the below error message:
500 Internal Server Error
java.lang.SecurityException: sealing violation at com.evermind.naming.ContextClassLoader.defineClass(ContextClassLoader.java:1153) at com.evermind.naming.ContextClassLoader.defineClass(ContextClassLoader.java:1065) at com.evermind.naming.ContextClassLoader.findClass(ContextClassLoader.java:404) at com.evermind.naming.ContextClassLoader.loadLocalClassFirst(ContextClassLoader.java:158) at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.java) at java.lang.ClassLoader.loadClass(ClassLoader.java) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java) at com.evermind.util.OC4JSecureClassLoader.defineClassEntry(OC4JSecureClassLoader.java:172) at com.evermind.naming.ContextClassLoader.defineClass(ContextClassLoader.java:1179) at com.evermind.naming.ContextClassLoader.defineClass(ContextClassLoader.java:1065) at com.evermind.naming.ContextClassLoader.findClass(ContextClassLoader.java:404) at com.evermind.naming.ContextClassLoader.loadLocalClassFirst(ContextClassLoader.java:158) at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.java) at java.lang.ClassLoader.loadClass(ClassLoader.java) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java) at com.evermind.util.OC4JSecureClassLoader.defineClassEntry(OC4JSecureClassLoader.java:172) at com.evermind.naming.ContextClassLoader.defineClass(ContextClassLoader.java:1179) at com.evermind.naming.ContextClassLoader.defineClass(ContextClassLoader.java:1065) at com.evermind.naming.ContextClassLoader.findClass(ContextClassLoader.java:404) at com.evermind.naming.ContextClassLoader.loadLocalClassFirst(ContextClassLoader.java:158) at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.java) at java.lang.ClassLoader.loadClass(ClassLoader.java) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:1655) at java.lang.Class.getMethod0(Class.java:1901) at java.lang.Class.getMethod(Class.java:984) at oracle.portal.utils.xml.v2.DefaultNodeHandler.findMethod(Unknown Source) at oracle.portal.utils.xml.v2.DefaultNodeHandler.setCustomValue(Unknown Source) at oracle.portal.utils.xml.v2.DefaultNodeHandler.handleSimpleElement(Unknown Source) at oracle.portal.utils.xml.v2.DefaultNodeHandler.processNode(Unknown Source) at oracle.portal.utils.xml.v2.DefaultNodeHandler.processNode(Unknown Source) at oracle.portal.provider.v2.http.DefaultProviderLoader.getProviderDefinition(Unknown Source) at oracle.portal.provider.v2.http.DefaultProviderLoader.validate(Unknown Source) at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.validate(Unknown Source) at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.showTestPage(Unknown Source) at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.handleHttp(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java) at oracle.webdb.provider.v2.adapter.SOAPServlet.doHTTPCall(Unknown Source) at oracle.webdb.provider.v2.adapter.SOAPServlet.service(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source) at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16) at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:669) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)
[b]provider.xml
<?xml version = '1.0' encoding = 'UTF-8'?>
<?providerDefinition version="3.1"?>
<provider class="oracle.portal.provider.v2.DefaultProviderDefinition">
<session>true</session>
<passAllUrlParams>true</passAllUrlParams>
<preferenceStore class="oracle.portal.provider.v2.preference.FilePreferenceStore">
<name>prefStore1</name>
<useHashing>true</useHashing>
</preferenceStore>
<portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
<id>1</id>
<name>MyTest2Portlet</name>
<title>My Test2 Portlet</title>
<description>My Test2 Portlet Description</description>
<timeout>40</timeout>
<showEditToPublic>false</showEditToPublic>
<hasAbout>false</hasAbout>
<showEdit>true</showEdit>
<hasHelp>false</hasHelp>
<showEditDefault>false</showEditDefault>
<showDetails>false</showDetails>
<renderer class="oracle.portal.provider.v2.render.RenderManager">
<renderContainer>true</renderContainer>
<renderCustomize>true</renderCustomize>
<autoRedirect>true</autoRedirect>
<contentType>text/html</contentType>
<showPage class="oracle.portal.provider.v2.render.http.StrutsRenderer">
<defaultAction>/portal/browseDeptEmp.do</defaultAction>
</showPage>
<editPage>/htdocs/mytest2portlet/MyTest2PortletEditPage.jsp</editPage>
</renderer>
<personalizationManager class="oracle.portal.provider.v2.personalize.PrefStorePersonalizationManager">
<dataClass>oracle.portal.provider.v2.personalize.NameValuePersonalizationObject</dataClass>
</personalizationManager>
</portlet>
</provider>
struts_config.xml
<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="DataForm" type="oracle.adf.controller.struts.forms.BindingContainerActionForm"/>
</form-beans>
<action-mappings>
<action path="/portal/browseDeptEmp" className="oracle.adf.controller.struts.actions.DataActionMapping" type="oracle.adf.controller.struts.actions.DataForwardAction" name="DataForm" parameter="/browseDeptEmp.uix">
<set-property property="modelReference" value="browseDeptEmpUIModel"/>
<forward name="formEmpLink" path="/portal/formEmp.do"/>
<forward name="createEmpLink" path="/portal/createEmpAction.do"/>
<forward name="searchEmpLink" path="/portal/searchEmp.do"/>
</action>
<action path="/portal/formEmp" className="oracle.adf.controller.struts.actions.DataActionMapping" type="oracle.adf.controller.struts.actions.DataForwardAction" name="DataForm" parameter="/formEmp.uix">
<set-property property="modelReference" value="formEmpUIModel"/>
</action>
<action path="/portal/createEmpAction" className="oracle.adf.controller.struts.actions.DataActionMapping" type="oracle.adf.controller.struts.actions.DataAction" name="DataForm">
<set-property property="modelReference" value="formEmpUIModel"/>
<set-property property="methodName" value="formEmpUIModel.Create"/>
<set-property property="resultLocation" value="${requestScope.methodResult}"/>
<set-property property="numParams" value="0"/>
<forward name="success" path="/portal/formEmp.do"/>
</action>
<action path="/portal/searchEmp" className="oracle.adf.controller.struts.actions.DataActionMapping" type="oracle.adf.controller.struts.actions.DataForwardAction" name="DataForm" parameter="/searchEmp.uix">
<set-property property="modelReference" value="searchEmpUIModel"/>
</action>
</action-mappings>
<message-resources parameter="view.ApplicationResources"/>
</struts-config>
web.xml
<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<description>Empty web.xml file for Web Application</description>
<context-param>
<param-name>CpxFileName</param-name>
<param-value>DataBindings</param-value>
</context-param>
<context-param>
<param-name>oracle.portal.log.LogLevel</param-name>
<param-value>4</param-value>
</context-param>
<filter>
<filter-name>ADFBindingFilter</filter-name>
<filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>windows-1252</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>ADFBindingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>ADFBindingFilter</filter-name>
<url-pattern>*.jspx</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>ADFBindingFilter</filter-name>
<servlet-name>uix</servlet-name>
</filter-mapping>
<!-- <filter-mapping>
<filter-name>ADFBindingFilter</filter-name>
<servlet-name>action</servlet-name>
</filter-mapping>
-->
<filter-mapping>
<filter-name>ADFBindingFilter</filter-name>
<servlet-name>SOAPServlet</servlet-name>
</filter-mapping>
<servlet>
<servlet-name>SOAPServlet</servlet-name>
<description>Extended Portal SOAP Server</description> <servlet-class>oracle.webdb.provider.v2.adapter.SOAPServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>uix</servlet-name>
<servlet-class>oracle.cabo.servlet.UIXServlet</servlet-class>
<init-param>
<param-name>oracle.cabo.servlet.pageBroker</param-name>
<param-value>oracle.cabo.servlet.xml.UIXPageBroker</param-value>
</init-param>
<init-param>
<param-name>oracle.cabo.servlet.UIXRequestListeners</param-name>
<param-value>oracle.cabo.adf.rt.InitModelListener</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>SOAPServlet</servlet-name>
<description>Extended Portal SOAP Server</description>
<servlet-class>oracle.webdb.provider.v2.adapter.SOAPServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>uix</servlet-name>
<url-pattern>*.uix</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>uix</servlet-name>
<url-pattern>/uix/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SOAPServlet</servlet-name>
<url-pattern>/providers</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SOAPServlet</servlet-name>
<url-pattern>/providers/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>35</session-timeout>
</session-config>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>index.uix</welcome-file>
</welcome-file-list>
</web-app>
someone please help me out.
Thank you so much -
Problem occurs when working with the struts and mYsql database
Hi all,
I am working on Struts and using database mysql. I am getting this error when i tries to modify the values of jsp page and after modify when i submit a page ,the values are modifying but it is showing this error.
After modifying the values i am forwarding the controller to the Display page where all records from the databse will be displayed.Please tell me how to solve.this..
Thanks
javax.servlet.ServletException: Cannot find bean employees in any scope
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:495)
at org.apache.jsp.viewEmployee_jsp._jspService(viewEmployee_jsp.java:208)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:627)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:306)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
root cause
javax.servlet.jsp.JspException: Cannot find bean employees in any scope
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:938)
at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:277)
at org.apache.jsp.viewEmployee_jsp._jspService(viewEmployee_jsp.java:124)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:627)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:306)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Apache Tomcat/4.1.31Hi,
i think you have got this sample application from Mastering Jakarta Struts book.
Try the following changes, you can escape from this exception:
1) In the employeelist.jsp, change the name attribute to "USER instead of "employees" as follows
<logic:iterate id="employee" name="USER">
and also <logic:present name="USER"> </logic:present> before and after the iterate tags.
2)In the EmployeeList Action.java,add the following in the excute method...
EmployeesActionMapping employeesMapping =
(EmployeesActionMapping)mapping;
if ( employeesMapping.isLoginRequired() ) {
HttpSession session = request.getSession();
if ( session.getAttribute("USER") == null ) {
System.out.println("session.getAttribute is NULL");
target = "login";
ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("errors.login.required"));
if (!errors.empty()) {
saveErrors(request, errors);
}else{
session.setAttribute("USER",getEmployees());
Thanks,
Shanmu -
JSP - Nested Jakarta Struts Logic Tags
Hi,
Simple question....
Can Jakarta Struts Logic tags be nested when coding JSP's
i.e.
==========================================
<logic:iterate id="searchSizeTracker" name="searchSizeTracker" type="uk.co.troutlure.bom.SearchTrackerObject" scope="request">
<logic:greaterEqual name='searchSizeTracker' property='page_no' value='<%searchActionForm.getCurrentPage()%>'>
<logic:lessEqual name='searchSizeTracker' property='page_no' value='<%searchActionForm.getMaxPage()%>'>
<logic:equal name='searchSizeTracker' property='page_no' value='<%searchActionForm.getCurrentPage()%>'>
<jsp:getProperty name="searchSizeTracker" property="page_no"/>
</logic:equal>
<logic:notEqual name='searchSizeTracker' property='page_no' value='<%searchActionForm.getCurrentPage()%>'>
<a href="<%=request.getContextPath()%>/performSearch.do?pageRequired=<bean:write name='searchSizeTracker' property='page_no'/>&action_id=<bean:write name='searchActionForm' property='currentActionId'/>&searchType=<bean:write name='searchActionForm' property='searchType'/>¤tScreen=search_reorder"><jsp:getProperty name="searchSizeTracker" property="page_no"/>
</a>
</logic:notEqual>
</logic:lessEqual>
</logic:greaterEqual>
</logic:iterate>
=========================================
The above code sample seems to fail to get past the first <logic:greaterEqual tag even though the conditions are met. And the iterator just loops throught the rest of the SearchTrackerObjects.
I'm not sure whether logic tags can be nested as shown???
Thanks in advance.Yes you should be able to nest logic tags like that.
However you seem to be wanting to limit the values that are iterated through using the greaterEqual and lessEqual tags.
I would suggest you use the offset and length attributes on the logic:iterate tag:
something like:
<logic:iterate id="searchSizeTracker" name="searchSizeTracker" type="uk.co.troutlure.bom.SearchTrackerObject" scope="request" offset ="<%searchActionForm.getCurrentPage()%>" length="<%searchActionForm.getMaxPage() - searchActionForm.getCurrentPage()%>">Cheers,
evnafets -
Struts and Tiles Problem:compiler error message
I imported the application "tiles-documentation.war" from jakarta-struts-1.1 into the newly installed JDevloper(Version 9.0.5.2 Build 1618) and try to make it running.
While with the former Jdeveloper 9.0.4 I can run it nicely(a few manual editing of some files, though), with this newer version I just can not proceed with the following error message.
Project: D:\jdev\mywork\oc4j_startup\tiles_doc\tiles_doc.jpr
D:\jakarta-struts-1.1\webapps\tiles-documentation\tutorial\common\menu.jsp
Error: package and class have same name: tutorial.common._menu
the same kind of message repeated many many times.
It seems that I can not probe any more...
Can someone help me out? Thanks in advanceRight so these where messages from the JSP compile or from the import process?
-
Struts 2 validation for HTML tags
Hi,
I am doing Struts2 validation with validation.xml for HTML tags. Here i am doing a binding between a form (bean) and the respective field in JSP and validation.xml. The validation error messages are populated without any problem but the value entered in the respective text field for HTML tags is not persisted. This problem does not occur if you use Struts 2 tags in JSP. Here is a snippet of what i am doing:-
JSP:-
<input:text name="accountForm.firstName" size="12" maxlength="20" />
Action:-
class AccountAction {
private AccountForm accountForm;
public void setAccountForm (AccountForm accountForm) {
this. accountForm = accountForm;
public String insertAccount () throws ApplicationException {
// To get the account details from the JSP
String first Name = accountForm.getFirstName ();
action-validation.xml:-
<validators>
<field name="accountBean.firstName">
<field-validator type="requiredstring">
<param name="trim">true</param>
<message> First Name is required.</message>
</field-validator>
</field>
<validators>
Whether it is possible to persist the value with HTML tags with Struts 2 validation? or i need to go with Struts 2 tags in JSP. Please shed some light in to it.
Thanks,
JavaCrazyLoverFYI
I am using spring framework with struts2 UI
..pls
do the needful..
Thanks in advance
-Satish -
Renaming Validation-rule.xml and Validation.xml
Hi
Is it possible to rename Validation-rule.xml and validation.xml files in the Struts Validation framework.
will the validation work both the files are renamed to say abc-rule.xml or xyz.xml.
please provide your feedback on this.
Thanks
Vikengvikeng wrote:
please provide your feedback on this.I think that it would be better if you asked that on an Apache Struts forum (or mailing list). -
How to know the balance and validity of internet data in iPad
How to know the balance and validity of internet data in iPad?
Sir I m using internet in ipad4 with airtel network
They provide me 2gb data with the amount of 255 rupees
And now I inserted the sim in my ipad4
And start the surfing on safari n all
And now I wanted to know how much data is balance. -
Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset preferences and still have problem. Slow to open and in force quit "Photoshop not responding" At this point should I uninstall and start over.
What are the performance Preferences?
-
How to Use the language function for assignment and validation
Hi All,
If anyone can explain me in details with example ,how to use the language function for assignments and validations?
Thanks
ArnabHi Arnab,
The expression is checked only for the current MDM session.
If u login with the ABC language it will always show the ABC language no matter how many times u execute it.
Try connecting to the DM with the XYZ language.
It should go to the if part rather than else.
Hope it helps.
Thanks,
Minaz -
How to get the latest and valid BOM item entry from STPO
hi,
may i know with what condition we can get the latest and valid BOM item entry from STPO table?
i have STLNR and IDNRK as a input. But i realized that it would return multiple entry due to the combination of valid-from and valid till date.
can i use stlnr,idnrk and stpoz (with the latet counter) to get the latest and valid BOM entry?
thank you.Hi
You can get the latest BOM either by using the latest valid from date DATUV or latest internal counter STPOZ
Regards
Shiva -
Difference between "Binding Period" and "Validity Start/End" in Bid
SRM Experts,
1. We see 2 different things, "Binding Period" and "Validity Start/End" while preparing the bid. What is the differece between these?
2. These fileds are non-editable for the bidder, while preparing the bid response. How bidder can give validity period for his quote (at header level)?
3. We see that, the bidder can specify validity start/end date at condition level. Is it not possible to specifiy a validity of the quote at header level?
GHcase1: After expiration of - binding period in RFx header:
case2: After expiration of - validity end period in RFx header:
case3: After expiration of - validity end period of RFx Response:
I created seprate documents for each cases.
I tried accepting the RFx response in all above 3 cases system did not give any error.
I tried creating the PO against the RFx response in all above 3 cases system did not give any error.
Is it correct behavior or is there any problem?
GH -
Help with Conditional Display and Validation
Version 4.1.1.00.23
Hello,
I'm having a difficult time with a conditional display and validation I'm hoping someone can help with.
Requirements:
When the Start Date (Datepicker) and/or End Date (Datepicker) change then display the Change Reason (Select List) and Change Description (Textbox)
If the page is saved without entering a Change Reason display a validation error message that the Change Reason cannot be empty (NULL)
What I've tried
Create a Dynamic Action on the Start Date
Event: Change
Selection Type:Item(s)
Items(s): P51_START_DATE
Condition: none
True Action Section:
Action: Show
Fire on Page Load: Checked
Show all page items on the same line: No
Affected Items Section:
Selection Type:Item(s)
Item(s): P51_CHANGE_REASON,P51_CHANGE_DESC
I've also created a Dynamic Action with similar settings for the P51_END_DATE.
I created a Validation for the P51_CHANGE_REASON as Function Returning Error Text:
DECLARE
v_start_date work_items.start_date%TYPE;
v_end_date work_items.end_date%TYPE;
BEGIN
SELECT start_date
,end_date
INTO v_start_date
,v_end_date
FROM work_items
WHERE work_items_id = :P51_WORK_ITEMS_ID;
IF ( (v_start_date != TO_DATE(:P51_START_DATE,'DD-MON-YYYY') OR v_end_date != TO_DATE(:P51_END_DATE,'DD-MON-YYYY') ) AND
:P51_CHANGE_REASON IS NULL ) THEN
RETURN 'Change Reason must have a value';
END IF;
END;
The Issue
I tried to create another Dynamic Action to hide the P51_CHANGE_REASON and P51_CHANGE_DESC fields on page load, but when either of the date fields are changed and the validation is fired the P51_CHANGE_REASON and P51_CHANGE_DESC are hidden again.
There are two buttons to submit the page: 'SAVE' will submit the page and stay on the page and 'SAVE_CHANGES' will submit the page and branch to the previous page (which is a report with EDIT buttons to edit the record).
I can't get the page load Dynamic Action to NOT fire when the validation is fired.
I hope this is clear and if not what information can I provide?
Thanks,
JoePhil,
Thank you for looking at this.
Yes if the Change Reason is NULL when the edit page is displayed then the Change Reason and Change Description fields are hidden. If the Start Date (Datepicker) and/or End Date (Datepicker) change then display the Change Reason (Select List) and Change Description (Textbox). If the page is saved without entering a Change Reason display a validation error message that the Change Reason cannot be empty (NULL).
The problem I'm having is that if no Change Reason is entered and the page is saved thereby firing the validation the Change Reason and Change Description fields are hidden again (because of the On-Load Dynamic Action to hide them). So now the user can't put in a Change Reason...unless they change one of the date fields again which isn't going to be accepted.
Is there a way to determine if a validation error was fired and be able to use that on the On-Load Dynamic Action to hide the two fields? Something like...If the validation fired then don't run?
Please let me know if I'm still confusing you.
Thanks,
Joe
Maybe you are looking for
-
I have installed iOS7 on my iPhone4. I am able to add/edit contacts by clicking the "contact" icon. But when I am trying to do the same after clicking the "phone" icon, it is not displaying the keypad. I believe it is a bug in iOS7. Please confirm. i
-
I am trying to set up ICloud on my Ipad. ICloud doesn't show up as an option in my settings. Help! I want to sync all of my content from my IMac to My Ipad
-
Upgrade to 5.1 Won't Open
Greetings. I own a G5 1.8 GHz PowerPC, 3 GB sdram running OS X 10.4.10. Yeah, it's an older model. This morning I attempted to upgrade my FCP 4.5 to 5.1. The installation appeared to be successful, but the software does not run whatsoever. It "unexpe
-
Runtime error CX_BSP_HOST_NOT_QUALIFIED
Dear All, Have anybode had this runtime error? Users get it but I cannot reproduce and I cannot find any OSS notes Any help appreciated Thanks Ioan
-
Lenovo b570 biometric sensor(finger print reader)
I been having a problem lately with my integrated biometric reader (fingerprint scanner) since probably march or april at times it would either not register my print like i never swiped my finger on it or say it couldnt read it and it would take mult