Error using struts
Hello all!! i am new at this forum and kind of new developing, so any help you can give me i'd really apreciate it.
I am using struts to develop a webapp, and when I deploy an action on the IE i get a message on the server cmd window:
<Error> <HTTP> <[WebAppServletContext(7404050,webappname,/webappname)] Root cause of ServletException
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at ............
I have my theories, but can you give me an idea of what can be the cause of this type of error???? (thanks in advanced)
Can't read your mind or the rest of the stack trace! If you'd have posted the remaining trace, it might have made some sense.
xH4x0r
Similar Messages
-
Error using Struts + ATG Dynamo 6.0 + Solaris
Hi all,
I get the following error when i go to a specific page in my application. This too happens randomly, i.e. not guaranteed. Sometime the error is shown, and sometimes the application run without such a problem, for a long time. I am using a Struts ,ATG Dynamo 6.0 and solaris.
What could be the porrisble reason for this ? Any help is highly appreciated.
**** Error Mon Jan 12 16:53:10 EST 2004 1073944390563
/atg/dynamo/service/j2ee/WebContainer --- CAUGHT AT:CONTAINER:
atg.servlet.ContainerServletException: Cannot send an error to the client,
the response has already been committed: null; SOURCE:jav
ax.servlet.ServletException
**** Error Mon Jan 12 16:53:10 EST 2004 1073944390563
/atg/dynamo/service/j2ee/WebContainer at atg.servlet.conta
iner.WebApplication.dispatchServletException(WebApplication.java:908)
**** Error Mon Jan 12 16:53:10 EST 2004 1073944390563
/atg/dynamo/service/j2ee/WebContainer at atg.servlet.conta
iner.WebApplication.dispatchRequest(WebApplication.java:709)
**** Error Mon Jan 12 16:53:10 EST 2004 1073944390563
/atg/dynamo/service/j2ee/WebContainer at atg.servlet.conta
iner.WebApplication.dispatchRequest(WebApplication.java:503)
**** Error Mon Jan 12 16:53:10 EST 2004 1073944390563
/atg/dynamo/service/j2ee/WebContainer at atg.servlet.conta
iner.GenericRequestDispatcher.include(GenericRequestDispatcher.java:638)
**** Error Mon Jan 12 16:53:10 EST 2004 1073944390563
/atg/dynamo/service/j2ee/WebContainer at org.apache.struts
.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilStrutsModulesImpl.java:
124)
**** Error Mon Jan 12 16:53:10 EST 2004 1073944390563
/atg/dynamo/service/j2ee/WebContainer at org.apache.struts
.tiles.TilesUtil.doInclude(TilesUtil.java:161)
**** Error Mon Jan 12 16:53:10 EST 2004 1073944390563
/atg/dynamo/service/j2ee/WebContainer at org.apache.struts
.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
**** Error Mon Jan 12 16:53:10 EST 2004 1073944390563
/atg/dynamo/service/j2ee/WebContainer at org.apache.struts
.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:818)
**** Error Mon Jan 12 16:53:10 EST 2004 1073944390563
/atg/dynamo/service/j2ee/WebContainer at org.apache.struts
.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
**** Error Mon Jan 12 16:53:10 EST 2004 1073944390563
/atg/dynamo/service/j2ee/WebContainer ....stack trace CROPPED afte
r 10 lines.
thanks.
swanHey Dude!
I am also facing same problem, If u could get any solution, plz do reply me.
And If I get, I'll do the vice-versa
[email protected]
Cheers!
Amitesh -
Error in using struts tag library
Platform information:
Windows XP
BEA Weblogic Server 8.1 (Developer)
Struts 1.1
I am unable to compile the following JSP in weblogic because it says there is
an error using the struts-html tag library. (Details about the error are mentioned
after the JSP)
My JSP file is:
===================================================================
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri='/WEB-INF/struts-template.tld' prefix='template' %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ page import="com.hipaaccelerator.runtime.HARuntime" %>
<jsp:useBean id='logonForm' scope='request' class='com.hipaaccelerator.hipaax.form.LogonForm'/>
<html:html>
<head>
<title>Logon</title>
<link rel='stylesheet' href="<html:rewrite page='/styles/default.css'/>" type='text/css'
>
<script language='javascript' src="<html:rewrite page='/scripts/default.js'/>"
type='text/javascript'></script>
</head>
<body>
<html:form action='/logon.do' >
<table border='0' align='center' >
<tr><td height='10'></td></tr>
<tr>
<td align='center'>
<html:img src='/images/Logo.gif' height='70'
width='449'/>
</td>
</tr>
<tr><td height='10'></td></tr>
</table>
<table align='center' width='100%' >
<tr><td height='10'></td></tr>
<tr>
<td height='20' width='10%'> </td>
<td height='20' colspan='3' align='center' style="font-size: 18pt; color:
blue;
background-color: white; text-align:center">PAC
</td>
<td height='20' width='10%'> </td>
</tr>
<tr><td height='10'></td></tr>
<tr>
<td height='20' width='10%'> </td>
<td height='20' width='8%'> </td>
<td height='20' align='center' style="border-style:solid; border-width:2pt;
font-
size: 10pt; color: red; background-color: white; text-align:center">
<%= HARuntime.instance().getConfig().getProperty("logonAnnouncement")
%>
</td>
<td height='20' width='8%'> </td>
<td height='20' width='10%'> </td>
</tr>
<tr><td height='10'></td></tr>
</table>
<table border='0' align='center' >
<tr>
<td class='formfieldname' ><b>User Name: </td>
<td class='formfield'>
<html:text property='username' maxlength='20' size='20'/>
</td>
</tr>
<tr><td class='formfieldspacer'></td></tr>
<td class='formfieldname' ><b>Password:</b> </td>
<td class='formfield'>
<html:password property="password" size="20" maxlength="20"
redisplay="false"/>
</td>
</tr>
<tr><td class='formfieldspacer'></td></tr>
<tr>
<td colspan='2' align='middle'>
<html:image src='/images/login.gif' onclick='document.forms[0].submit();
return false;' />
</td>
</tr>
</table>
<br><br>
</html:form>
</body>
</html:html>
===================================================================
The translation of this page fails with the following error:
<Dec 16, 2003 5:06:13 PM MST> <Error> <HTTP> <BEA-101045> <[ServletContext(id=4595,name=hipaax,context-path=/hipaax)]
translation of /logon.jsp failed:
weblogic.servlet.jsp.JspException: (line 1): Error in using tag library uri='/WEB-INF/struts-html.tld'
prefix='html': The Tag class 'org.apache.struts.taglib.html.BaseTag' has no setter
method corresponding to TLD declared attribute 'server', (JSP 1.1 spec, 5.4.1)>
===================================================================
I have struts.jar in /web-inf/lib. I have taglib (uri and location) definitions
in web.xml.I have all the struts tld files under /web-inf. Is there anything
else I have to do?
Any help would be greatly appreciated.
Thank you.
SharmilaUpdate: I just looked up the WL version and it's 8.1 sp3
So, I guess, JSTL 1.1 (which includes jstl fn tags) is not supported by WL.... Someone correct me if I am wrong.
Thanks,
pal :) -
Want to show errors to user using struts !!
Hi, I am working on a application which is using struts framework., If any errors / exceptions occur, then they are forwarded to Fail.jsp.
if (!errors.isEmpty()) {
saveErrors(request, errors);
// Forward control to the appropriate 'failure' URI (change name as desired)
forward = mapping.findForward("fail");I want to show to the user. the error/exception that occured. How can i send these errors to Fail.jsp. Please advice. thanks !!Then maybe you should go learn Struts before you come to a Java (not to be confused with Struts) forum and post unrelated questions. No go and get before I take a switch to ya! Ya bes simma!
-
How to assign bean value to a local variable in JSP using struts.
Hi everybody!
I've a problem that puzzled me on how to assign a bean value to a local variable like String in JSP using struts.
we can have someting like this to display the value
<bean:write name="detailService" property="status" />or
<bean:define id="theStatus" name="detailService" property="status"/>
This is country: <%=theStatus%>but an error occured when I tried like this:
String currentStatus = "<bean:define id="theStatus" name="detailService" property="status"/>";
or
String currentStatus = "<bean:write name="detailService" property="status" />";Is there a way to do this?.....
Any help pretty much appreciatedJava != JSP.
The <bean:define> and <bean:write> tags are custom tags meant to appear in the HTML section of a JSP file, as opposed to the scriptlet section. They actually get turned into java code as part of the translation process.
The <bean:write> tag naturally just writes out what you tell it to.
The <bean:define> tag defines a local variable, and gives it a value.
this should do it.
<bean:define id="theStatus" name="detailService" property="status" type="java.lang.String"/>
<%
String currentStatus = theStatus;
%>With the advent of JSTL, you shouldn't really need to use scriptlet code anymore. Personally I am for 0% scriptlet code in any jsp I write. -
Issue in converting Struts view to JSF view using struts-faces integration
Hi All,
I am facing a issue in my Sruts to JSF conversion application using struts-faces.jar integration library.
Need expert's help desperately as I am not able to use <s:form> tag in my new jsf page to call a struts action.
I want to call a struts action from my web page designed using JSF,
but it seems impossible without using <s:form> tag from struts-faces integration library.
Please suggest how to resolve this...
I am using WSAD 5.1 IDE with inbuilt Test environment WebSphere server
JSF Version: Sun's RI 1.1
Struts framework: 1.2.6
Struts-Faces Integration Library version: 1.0
I have configured a controller element in struts-config.xml file as has been suggested by different online
documents I studied:
<controller>
<set-property property="processorClass"
value="org.apache.struts.faces.application.FacesRequestProcessor"/>
</controller>
But configuring a controller does not allow my test server to start up properly and due to errors the ActionServlet also becomes unavailable.
If I comment the controller and start the test server it starts fine but then I cannot access the converted jsf page which contains the <s:form action="/xxxxx.do"> tag.
If now I get back to <h:form> tag instead of <s:form> tag with a <h:commandButton action="xxxx.do"/> for form submission in my jsf page, I see the html page generated with all components but now checking the html source generated I see
<form action="/contextName/jspFolder/sameDisplayedPage.jsf"> which is not valid and never gets called successfully.
I think someways I need to use the <s:form> tag with the controller configured properly to use the struts-faces integration library's request processor, to get things working. But HOW???
Following is the error I get if I use the <controller> tag element in struts-config.xml file and start the server.
This error appears on starting the server without accessing any application's jsp web page
[6/12/06 15:31:14:109 IST] 3e311815 ActionServlet E org.apache.struts.action.ActionServlet Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.
[6/12/06 15:31:14:109 IST] 3e311815 ActionServlet E org.apache.struts.action.ActionServlet TRAS0014I: The following exception was logged java.lang.IllegalAccessError: org.apache.commons.digester.SetPropertyRule tried to access method org/apache/commons/beanutils/BeanUtils.setProperty(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V
at org.apache.commons.digester.SetPropertyRule.begin(SetPropertyRule.java:198)
at org.apache.commons.digester.Rule.begin(Rule.java:200)
at org.apache.commons.digester.Digester.startElement(Digester.java:1273)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:736)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:685)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:331)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)
at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)
at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:870)
at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542)
at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1277)
at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:283)
at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:387)
at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:209)
at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:987)
at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136)
at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:418)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:787)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:354)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:575)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:271)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:249)
at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:125)
at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:183)
at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:386)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)
[6/12/06 15:31:14:188 IST] 3e311815 WebGroup E SRVE0020E: [Servlet Error]-[ActionServlet]: Failed to load servlet: javax.servlet.UnavailableException: org.apache.commons.digester.SetPropertyRule tried to access method org/apache/commons/beanutils/BeanUtils.setProperty(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:366)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)
at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)
at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:870)
at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542)
at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1277)
at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:283)
at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:387)
at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:209)
at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:987)
at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136)
at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:418)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:787)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:354)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:575)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:271)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:249)
at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:125)
at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:183)
at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:386)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)
(same error message re-iterates/repeats itself... and finally -
Error 503: Failed to load target servlet [ActionServlet] comes in web-browser
Following is the error which I get if I comment the <controller> element in the struts-config.xml file
and use a <s:form action="xxxxx.do"> in the struts converted jsf page. The web-server starts fine, but
accessing the jsf page givers error as:
[6/12/06 15:38:00:781 IST] 696f19de WebGroup I SRVE0180I: [Sample Struts-JSF integration application] [training2] [Servlet.LOG]: /jsp/welcomeF.jsp: init
[6/12/06 15:38:01:219 IST] 696f19de WebGroup E SRVE0026E: [Servlet Error]-[]: java.lang.NullPointerException
at org.apache.struts.faces.renderer.FormRenderer.encodeBegin(FormRenderer.java:114)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)
at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:591)
at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:478)
at org.apache.jsp._welcomeF._jspService(_welcomeF.java:207)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:662)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
at org.apache.struts.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1054)
at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:992)
at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:551)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1192)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:412)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
Finally if I change my <s:form action="xxxxx.do"> tag to
<h:form>
<h:commandButton id="submit" action="xxxx.do" value="Submit" />
I see the webpage coming up in the browser (no controller element used in struts-config.xml file this time)
But in the html source of this html created from jsf I see
<form id="_id2" method="post" action="/training2/jsp/welcomeF.faces" enctype="application/x-www-form-urlencoded">
here form's action attribute is pointing to the same displayed page with the context name prefixed. I
assume it is because jsf could not resolve the "xxxx.do" action to anything so set it to the same displayed page.
May be I am wrong as usual...
Below is the simple struts jsp page which I need to convert to jsf page as I am converting only the View part of application.
I want to use the same struts beans and application logic at the back-end. At front-end I need UIComponents from JSF to be used.
Following is the struts jsp page
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
<%@ taglib prefix="html" uri="/WEB-INF/lib/struts-html.tld" %>
<%@ taglib prefix="bean" uri="/WEB-INF/lib/struts-bean.tld" %>
<html:html>
<html:base/>
<html:messages id="messages" />
<font style="color:red; font=weight:italic; font-family: century gothic">
<html:errors/>
</font>
<BODY>
<P>Sample Struts and JSF integration example</P>
<P>This one is being displayed via Struts specific tags</P>
<html:form action="validateUser.do">
<bean:message key="label.name" /> : <html:text property="name" />
<bean:message key="label.password" /> : <html:password property="password" />
<bean:message key="label.age" /> : <html:text property="age" />
<bean:message key="label.city" /> : <html:text property="city" />
<bean:message key="label.address" /> : <html:text property="address" />
<html:submit property="submit" value="Show info via Struts" />
</html:form>
</BODY>
</html:html>
I have converted it into the following jsf page
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://struts.apache.org/tags-faces" prefix="s" %>
<f:view>
<HTML><BODY>
<f:verbatim><P>Sample Struts and JSF integration example</P></f:verbatim>
<f:verbatim><P>This one is being displayed via JSF tags</P></f:verbatim>
<h:form> <!-- Want to use s:form tag instead of this h:form tag -->
<h:inputText id="name" value="#{userForm.name}" /><f:verbatim>
</f:verbatim>
<h:inputSecret id="password" value="#{userForm.password}" /><f:verbatim>
</f:verbatim>
<h:inputText id="age" value="#{userForm.age}" /><f:verbatim>
</f:verbatim>
<h:inputText id="city" value="#{userForm.city}" /><f:verbatim>
</f:verbatim>
<h:inputText id="address" value="#{userForm.address}" /><f:verbatim>
</f:verbatim>
<h:commandButton id="submit" action="#{user.facesAction}" value="Show info via Struts" />
</h:form>
</BODY></HTML>
</f:view>
I am very hopeful of some answer from respected group experts, please help me.
I am in urgency of course but would not push for immed. response like other, just want some help for sure that is going to
be extremely valuable to me. Anticipating a helping hand...
Thanks and Regards
Vishal Sharm
Time's fun when you're having flies � Kermit, the Frog
-------------------------------------------------------------------------I've managed to get this working Ok from JDeveloper:
See:
http://www.groundside.com/blog/content/DuncanMills/J2EE+Development/?permalink=573FDB6F8D918B9704907899635CABB1.txt
http://www.groundside.com/blog/content/DuncanMills/J2EE+Development/?permalink=2B04ACE99A6437EDED775F15553D1DED.txt
Basically you just have to fiddle around with Library settings to get this working OK.
As to how useful this is, well that's up to you - I'd not regard Faces + Struts as a must use combination, rather it's a can mix if you really need to. Look at Faces and Faces navigation first and see if that actually gives you enough before you start to look at mixing. -
Loading Collections in to DropDownList box using Struts with bean
Hi folks,
I am very new to struts.
I am developing one small web application using struts. I has developed Bussiness Logic, i need to use properly in struts.
ManufacturerList.java is a Bussiness Logic class using to load all manufacturer from the database. It using by the collection LinkedHashMap.
I need to use this BL in my struts application.
GOAL: In sturts application i need to add the car details, one of the property for car is manufacturer.
When creating the car, it should display all the manufacturer in the new student form.
Please explain how to create with struts.
Some of the Code i developed
{color:#ff0000}<html:form action="/Car?op=saveCar">
<html:errors/>
<html:hidden property="op" value="saveCar"/>
<html:hidden property="carCode"/>
Car Name <html:text property="model"></html:text> <br>
Manufacturer
<!-- Defining the bean for manufacturer list getting from the request-->
<bean:define id="mfrList" name="ManufacturerList" property="manufacturers"
scope="request"
type="java.util.Collection">
</bean:define>
<br>
Manufacturer Year <html:text property="yearOfManufacture"></html:text><br>
Date of Purchase <html:text property="dateOfPurchase"></html:text> <br>
<html:submit value="Ok" />
</html:form>{color}
This is code is not working properly.... Please explainHi i did like this
{color:#0000ff}<bean:define id="mfrList" name="ManufacturerList" {color}
{color:#0000ff}scope="request" {color}
{color:#0000ff}type="com.icalib.trafficSimulator.ManufacturerList">{color}
{color:#0000ff}</bean:define>{color}
{color:#0000ff}<html:select property="make">{color}
{color:#0000ff}<html:optionsCollection name="mfrList" label="mfrName" value="mfrCode"/>{color}
{color:#0000ff}</html:select>{color}
But the error is comming like thisjavax.servlet.ServletException: Cannot create iterator for 1:Honda
2:Maruti
3:Hyundai
4:Toyota
5:Accord
6:Test_mfr
7:test_mfr2
8:456
9:again
10:123
11:again1
What to give in the label and value in the optionsCollection -
hi, i m newbie..
how can i use struts in my jsp page.
i have Jakarta Tomcat4.1.24 ,i configured the struts in following way
Tomcat_home/webapps/root/Registeruser
in ---registeruser
---web-inf
----classes
----lib
strut.jar and servlet.jar
-----src
-----index.jsp
and in web-inf i put some of the tld files
i m getting this error
org.apache.jasper.JasperException: File "/WEB-INF/struts-bean.tld" not found
so what is the suggestion
? -
Urgently!! Deploy project using Struts and Toplink
Hello. I want to make a deploy of a project in wich I'm using Struts and Toplink technologies.
I'm using JDeveloper 10g for Windows and my production server is a SUN V880 with Soloaris 8 and I make it ok, but when I run it since a PC in the intranet the following errors appears (obviously those don't appear before):
java.lang.NullPointerException at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:309) at jsp.login._jspService(_login.java:50) [SRC:/jsp/login.jsp:5] at com.orionserver[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:567) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:208) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:125) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:536)
Thank you so much for help.NOO!! :( I don't install any libraries in the server, but in the WAR file of the application, in the lib folder, there was the jars corresponding. I thought that those libraries, in the WAR file, was "local" to the project, anyway, the Struts and Toplink libraries must be global at server level, 'cause I will use it sure once agian, and now I'm trying to install those in the server...
Thank you so much!! -
Display date in jsp. using struts, JSTL
want to display today's date in format October 18, 2006
how to get today's date and how to display it in jsp?
I am using struts framwork and JSTL tags in my JSP.
Thanks.rizza_99 wrote:
The page underlines {<fmt:formatDate value="${now}" type="both" dateStyle="long" />} says
attributte value doesn't accept any expressionsWait, you said "the page underlines"?? So you're using an IDE? Are you sure that it a JSTL problem and not an IDE problem? Ignore the IDE and just execute the code. Does it work without any compilation errors or runtime exceptions? If so, then there's a problem in the IDE. -
Stuck with HotSpot Virtual Machine Error, Internal Error in struts
Hi i use to get this the following error message in my page ,while i am using struts and cann't understand why this error is raised can any body help me in this regard,as i have check nearly all the other possibilities of error.
# HotSpot Virtual Machine Error, Internal Error
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
# Java VM: Java HotSpot(TM) Client VM (1.4.2_01-b06 mixed mode)
# Error ID: 52454C4F4341544F520E43505001E7
# Problematic Thread: prio=5 tid=0x035dd210 nid=0x7dc runnable
Heap at VM Abort:
Heap
def new generation total 1728K, used 464K [0x10010000, 0x101e0000, 0x104f0000)
eden space 1600K, 21% used [0x10010000, 0x10064218, 0x101a0000)
from space 128K, 99% used [0x101c0000, 0x101dfff8, 0x101e0000)
to space 128K, 0% used [0x101a0000, 0x101a0000, 0x101c0000)
tenured generation total 41916K, used 40307K [0x104f0000, 0x12ddf000, 0x14010000)
the space 41916K, 96% used [0x104f0000, 0x12c4ceb8, 0x12c4d000, 0x12ddf000)
compacting perm gen total 38656K, used 35140K [0x14010000, 0x165d0000, 0x18010000)
the space 38656K, 90% used [0x14010000, 0x16261230, 0x16261400, 0x165d0000)I have ealso tried to increase my pages buffer size to 1000K but still getting the same error
-
Using Struts Example in IPlanet web Server 6.0
Hai
i am new to struts and i was trying to run the example application shiped along with the binary distribution
in iplanet webserver 6.0.
I have extracted the struts-example.war file in to a folder named strutsexamples under my iplanetdocroot\servers\docs\ Using the
link DeployWebApplications in the admin side of the iplanet application.
By doing the above steps all the example files are extracted in to the folder iplanetdocroot\servers\docs\strutsexamples directory .
Problem 1: when i restarted the server i found the following error in the log file
[06/Apr/2003:19:58:03] info ( 394): successful server startup
[06/Apr/2003:19:58:03] info ( 394): iPlanet-WebServer-Enterprise/6.0SP1 B08/20/2001 01:49
[06/Apr/2003:19:58:05] info ( 394): Installing a new configuration
[06/Apr/2003:19:58:05] info ( 394): [LS ls1] http://gdcblr1596.gdcblr, port 80 ready to accept requests
[06/Apr/2003:19:58:05] info ( 394): A new configuration was successfully installed
[06/Apr/2003:19:58:09] info ( 394): Loading IWSSessionManager by default.
[06/Apr/2003:19:58:09] info ( 394): IWSSessionManager: Maximum number of sessions is 1000
[06/Apr/2003:19:58:10] info ( 394): Adding web application (/diva) at (E:/iPlanet/Servers/docs/diva)
[06/Apr/2003:19:58:10] info ( 394): Loading IWSSessionManager by default.
[06/Apr/2003:19:58:10] info ( 394): IWSSessionManager: Maximum number of sessions is 1000
[06/Apr/2003:19:58:10] info ( 394): Adding web application (/struts) at (E:/iPlanet/Servers/docs/struts)
[06/Apr/2003:19:58:10] info ( 394): Loading IWSSessionManager by default.
[06/Apr/2003:19:58:10] info ( 394): IWSSessionManager: Maximum number of sessions is 1000
[06/Apr/2003:19:58:10] info ( 394): Adding web application (/strutsexamples) at (E:/iPlanet/Servers/docs/strutsexamples)
[06/Apr/2003:19:58:10] info ( 394): Loading IWSSessionManager by default.
[06/Apr/2003:19:58:10] info ( 394): IWSSessionManager: Maximum number of sessions is 1000
[06/Apr/2003:19:58:11] info ( 394): vs(https-gdcblr1596.gdcblr)servlet 'action' class = 'org.apache.struts.action.ActionServlet' loaded in context = '/strutsexamples'
[06/Apr/2003:19:58:11] info ( 394): action: init
[06/Apr/2003:19:58:13] warning ( 394): vs(https-gdcblr1596.gdcblr)ServletException thrown in servlet.init; context = /strutsexamples, servlet = 'action'; stack tace: javax.servlet.UnavailableException: Parsing error processing resource path
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java, Compiled Code)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java, Compiled Code)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.iplanet.server.http.servlet.WServletEntity.loadAndInitServlet(WServletEntity.java:98)
at com.iplanet.server.http.servlet.WebApplication.init(WebApplication.java, Compiled Code)
at com.iplanet.server.http.servlet.VirtualServer.init(VirtualServer.java, Compiled Code)
at com.iplanet.server.http.servlet.NSServletRunner.VSInit(NSServletRunner.java:680)
, root cause:
[06/Apr/2003:19:58:13] info ( 394): Successfully initialized web application environment (web-apps.xml) for virtual server (https-gdcblr1596.gdcblr)
Problem 2: when i was trying to invoke the example by typing http://localhost/strutsexamples/ i am getting only the following errors .
[06/Apr/2003:20:03:17] info ( 394): vs(https-gdcblr1596.gdcblr)servlet 'jsp' class = 'org.apache.jasper.servlet.JspServlet' loaded in context = '/strutsexamples'
[06/Apr/2003:20:03:17] info ( 394): jsp: init
[06/Apr/2003:20:03:18] info ( 394): jsp: init
[06/Apr/2003:20:03:19] failure ( 394): Internal error: servlet service function had thrown ServletException (uri=/strutsexamples/): javax.servlet.ServletException, stack: javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:453)
at jsps.index_jsp._jspService(_index_jsp.java, Compiled Code)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:247)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.access$6(JspServlet.java:237)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:520)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:589)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:891)
at com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1064)
at com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:953)
, root cause: javax.servlet.jsp.JspException
at org.apache.struts.util.RequestUtils.message(RequestUtils.java:975)
at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:294)
at jsps.index_jsp._jspService(_index_jsp.java, Compiled Code)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:247)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.access$6(JspServlet.java:237)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:520)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:589)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:891)
at com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1064)
at com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:953)
I have read all the FAQ and searched in web also and i am not able to find any answer to my problem .
Kindly if someone knows how to overcome the above problem do reply me to this id .
If any one has got the steps to be done to use struts in IplanetWebServer 6.0 do mail me also .
thanks and regards
Divakar.Renganathan
Associate Consultant
MascotSystems .
Bangalore.Hi,
Were you successful in getting the steps for incorporating struts with iPlanet Web Server 6.0 ?
If so, please email them to me as I am having similar problems.
Thanks
Harinder
[email protected] -
URGENT: Is it possible to upload multiple files using STRUTS
Hi,
Is it possible to upload multiple files using STRUTS.
I am able to upload a single file. But how do i upload multiple files ??
upload.jsp
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html>
<head>
<title>New Page 1</title>
</head>
<body>
<html:form action="/secure/uploadFile.do" enctype="multipart/form-data" method="POST" type="com.smartstream.webconnect.user.actions.UploadActionForm">
<p>File to upload
<html:file property="fileUpload" size="20"/></p>
<p><html:submit/></p>
</html:form>
</body>
</html:html>
UploadAction.java
public class UploadAction extends BaseAction {
Logger log = Logger.getLogger(AttachMessageAction.class);
public ActionForward executeAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ActionException {
System.out.println("executeAction of UploadAction");
UploadActionForm uploadActionForm = (UploadActionForm) form;
int fileSize = uploadActionForm.getFileUpload().getFileSize();
System.out.println("uploadActionForm.getFileUpload().getFileSize() = " + uploadActionForm.getFileUpload().getFileSize());
byte buffer[] = new byte[1024];
try {
BufferedInputStream bufferedInputStream = new BufferedInputStream(uploadActionForm.getFileUpload().getInputStream());
FileOutputStream fos = new FileOutputStream("s:\\uploaded\\" + uploadActionForm.getFileUpload().getFileName());
int read;
while ( (read = bufferedInputStream.read(buffer,0,buffer.length)) != -1) {
fos.write(buffer, 0, read);
fos.flush();
fos.close();
bufferedInputStream.close();
return mapping.findForward("success");
} catch (IOException e) {
e.printStackTrace();
return mapping.findForward("error");
}catch(OutOfMemoryError o){
o.printStackTrace();
System.out.println("o.getMessage() " + o.getMessage());
return mapping.findForward("error");
UploadActionForm.java
public class UploadActionForm extends ActionForm{
private FormFile fileUpload;
private byte[] fileContent;
public FormFile getFileUpload() {
org.apache.struts.taglib.html.FormTag _jspx_th_html_form_0;
return fileUpload;
public byte[] getFileContent() {
return fileContent;
public void setFileUpload(FormFile fileUpload) {
this.fileUpload = fileUpload;
public void setFileContent(byte[] fileContent) {
this.fileContent = fileContent;
}--Bhupendra MahajanYes, you could try using the multipart handler...
But I have a better idea...
Determine the maximum number of file uploads that the
user can do at one time. I mean, you can't
realistically have the user upload a million files at
one time. So say the max is 20. So you create your
action form class with 20 FormFile fields called file1
to file20.
Then when you dynamically create your page, you
dynamically create the specified number of file fields
and 1 hidden field called "totalFiles" which contains
the number of file fields you created. This should be
an int field in the form bean.
Then when you do your action processing, you just loop
thru the totalFiles... Or well, actually, you may not
need that at all. You could just check all the
FormFile fields and whatever ones aren't null contain
files.But what about UploadActionForm.java[b]
How do i have exact mapping of the HTML form in this file ??
--[b]Bhupendra Mahajan -
Problem in application that using struts
Hello to all ,
I am using struts in order to develop my application and i try to run my application in tomcat and i get the next error :
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Module 'null' not found.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.NullPointerException: Module 'null' not found.
org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755)
org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:364)
org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:285)
org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:445)
org.apache.struts.taglib.html.LinkTag.doEndTag(LinkTag.java:353)
org.apache.jsp.index_jsp._jspx_meth_html_005flink_005f0(index_jsp.java:150)
org.apache.jsp.index_jsp._jspx_meth_html_005fhtml_005f0(index_jsp.java:103)
org.apache.jsp.index_jsp._jspService(index_jsp.java:67)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.
If someone can help me and tell me what this error mean , all the files is in the right place , what it can be ?AshokMor wrote:
to solve your problem you can do one thing... change your struts-config.xml file as per sugesstion.
please add one more attribute in your <forward> element for that acction mapping.
like *<forward .... redirect="true" />*Hi,
It's great that you want to help, but please don't resurrect old threads. The question was asked about 1 year ago.
Kaj -
Bussines rules problems using Struts + BC4J
Hi, I'm using struts + bc4j and I have some problems with the validations made on the entities.
Looks like sometimes, struts didn't shows the error message until the commit is made. But the problem is that on the navigator shows me the stack trace of the exception, but only when I do the commit of the transaction.
In the test of the application module, the business rules works perfectly.
If somebody can help me i will aprecciate it.
Thanks
Daniel GonzalezThere are already some threads on this topic.
Unfortunately, they don't give solutions - not yet ;)
Custom Method Validator
addVetoableChangeListener for attribute doesn't seem to get fired
HTH,
Adrian
Maybe you are looking for
-
No Mouse or Keyboard entry..., have to replug the USB cord
After replacing the HDD to 500GB and adding RAM (+ 2x500MB, total 1,25GB RAM) i now occasionaly have problems with mouse or keyboard: suddenly no response to mouse or keyboard and i need to replug the USB cord to get it working again. Also, after the
-
Accept Mail from another server
We are testing a migration scenario and are running into a few issues. I have our new mail server setup with the same domain as our old. We will slowly be migrating from the old to the new, sort of like a split domain. The old server is running Group
-
Why is the number of e-mails higher on my iPhone than in my e-mail when I log into it from my computer? And how do I fix it? The number keeps climbing on my phone, making the difference between the two greater.
-
How to extract data from database to XSLT?
I want to generate a report by XSLT, but the data is extracted from the database. I will use Access/SQL server for my database. Can i write SQL in XSLT to extract data from database? Have any sample code or reference website to show how it work? THX
-
Curly quotes that don't come through from Word
Every now and then I get a Word file with a few quotes that come through to CS3 as accented characters instead of quotes. Anyone know why this happens? Download this zip file: http://www.pegtype.com/quotesdontwork.zip unzip it, and Place the Word fil