Help coderanch get a
new server
by contributing to the fundraiser

Gudavy Hu

Greenhorn
+ Follow
since Apr 11, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gudavy Hu

That happened when a request is submitted to a struts action. The original stack trace is as follows. Thanks a lot in advance.
Error Message:
Error Code: 500
Target Servlet: null
Error Stack:
java.lang.IllegalArgumentException
at com.ibm.servlet.engine.webapp.RequestUtils.parseQueryString(RequestUtils.java:262)
at com.ibm.servlet.engine.webapp.RequestUtils.parsePostData(RequestUtils.java:378)
at com.ibm.servlet.engine.srt.SRTServletRequest.parseParameters(SRTServletRequest.java:671)
at com.ibm.servlet.engine.srt.SRTServletRequest.getParameterNames(SRTServletRequest.java:349)
at com.ibm.servlet.engine.webapp.HttpServletRequestProxy.getParameterNames(HttpServletRequestProxy.java:212)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:743)
at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:2061)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1563)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:167)
at com.ibm.servlet.engine.webapp.ServicingServletState.service(StrictLifecycleServlet.java:317)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:110)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:678)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:331)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:117)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:239)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:154)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:323)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:137)
20 years ago
Code:
1. file "mytemplate.jsp":
<%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<TABLE WIDTH="760">
<TR>
<TD ALIGN="center" VALIGN="top">
<template:get name='headerframe'/>
</TD>
</TR>
</TABLE>
<TABLE WIDTH="760">
<TR>
<TD HEIGHT="10" ALIGN="center" VALIGN="top"></TD>
</TR>
</TABLE>
<TABLE>
<TR>
<TD>
<TABLE WIDTH="760">
<TR>
<template:get name='leftframe'/>
<TD WIDTH="15"></TD>
<TD VALIGN="top">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD VALIGN="top" WIDTH="412">
<template:get name='content'/>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
2. file "headerFrame.jsp":
<%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %>
<%@ taglib uri='/WEB-INF/tlds/struts-bean.tld' prefix='bean' %>
<!--Start the header-->
<TABLE>
<TR>
<TD WIDTH="1"></TD>
<TD WIDTH="200" HEIGHT="60" ALIGN="CENTER">
<IMG height=48 alt="my picture" src="myImage.gif" width=140></TD>
<TD WIDTH="1"></TD>
<TD WIDTH="558">
</TD>
</TR>
</TABLE>
<!--end of header -->
3.file "leftFrame.jsp":
<%@ taglib uri='/WEB-INF/tlds/struts-bean.tld' prefix='bean' %>
<%@ taglib uri='/WEB-INF/tlds/struts-logic.tld' prefix='logic' %>
<%@ taglib uri='/WEB-INF/tlds/struts-html.tld' prefix='html' %>
<!-- start the left frame -->
<TD WIDTH="159">
<TABLE WIDTH="159">
<TR>
<TD VALIGN="CENTER" ALIGN="CENTER" WIDTH="159">
<TABLE WIDTH="157">
<TR>
<TD WIDTH="10"></TD>
<TD>
the content list ......
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</TD>
<!-- end of the left frame -->
4. file "myContent.jsp":
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<!-- start the content -->
<table>
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td>Some content</td>
<td>Some content</td>
</tr>
</table>
<!-- end of the content -->
5. file "index.jsp":
<%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %>
<template:insert template='mytemplate.jsp'>
<template ut name="title" content="Welcome to the My Web Site!" direct="true"/>
<template ut name='headerframe' content='headerFrame.jsp' />
<template ut name='leftframe' content='leftFrame.jsp'/>
<template ut name='content' content='myContent.jsp' />
</template:insert>
6. after starting the "Websphere Test Environment" in VAJ, and loading the "index.jsp", the page is displayed, but in a mass. The following is the source of the page I got by "view source":
<!-- start the header -->
<TABLE>
<TR>
<TD WIDTH="1"></TD>
<TD WIDTH="200" HEIGHT="60" ALIGN="CENTER">
<IMG height=48 alt="my picture" src="myImage.gif" width=140></TD>
<TD WIDTH="1"></TD>
<TD WIDTH="558">
</TD>
</TR>
</TABLE>
<!-- end of header -->
<!-- start the left frame -->
<TD WIDTH="159">
<TABLE WIDTH="159">
<TR>
<TD VALIGN="CENTER" ALIGN="CENTER" WIDTH="159">
<TABLE WIDTH="157">
<TR>
<TD WIDTH="10"></TD>
<TD>
the content list ......
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</TD>
<!-- end of the left frame -->
<!-- start the content -->
<table>
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td>Some content</td>
<td>Some content</td>
</tr>
</table>
<!-- end of the content -->
<HTML>
<HEAD>
</HEAD>
<BODY>
<TABLE WIDTH="760">
<TR>
<TD ALIGN="center" VALIGN="top">

</TD>
</TR>
</TABLE>
<TABLE WIDTH="760">
<TR>
<TD HEIGHT="10" ALIGN="center" VALIGN="top"></TD>
</TR>
</TABLE>
<TABLE>
<TR>
<TD>
<TABLE WIDTH="760">
<TR>

<TD WIDTH="15"></TD>
<TD VALIGN="top">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD VALIGN="top" WIDTH="412">

</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
How Can I make it work properly? The code works well without any problem in Tomcat.
Thanks!
22 years ago
I am running Struts in VasualAge for Java. It works but after every action is finished, the console will display:
In HelloWorldServlet destroy
In HelloWorldServlet init
........
followed by the information of restarting the servlet engine.
Because the servlet engine is restarted, everything that put into the session and request is lost. So the following action will get some problems.
Can body help me?
Thanks so much!
22 years ago
I am trying to compress many files into a .jar file. These files to be compressed are distributed in different depth directories. I am using the JarInputStream and JarOutputStream as foloowing:
public void createJar(String fileName, File file)
throws Exception {
FileOutputStream out = new FileOutputStream(fileName);
FileInputStream fis = null;
JarOutputStream jar = new JarOutputStream(out, new Manifest());
try {
byte[] buffer = new byte[1024];
int bytesRead;
String files[] = file.list();
for (int i = 1; i < files.length; i++) {
String fileName = files[i];
fis = new FileInputStream(fileName);
JarEntry entry = new JarEntry(fileName);
jar.putNextEntry(entry);
while ((bytesRead = fis.read(buffer)) != -1) {
jar.write(buffer, 0, bytesRead);
}
}
} catch (IOException io) {
throw new Exception("In JarFileManager createJar() method");
} finally {
if(fis != null){ fis.close(); }
if(jar != null){ jar.close(); }
}
But it does not work. I got a Exception:
java.io.FileNotFoundException: Your.jar (The system cannot find the file specified)
"Your.jar" is the parameter I passed to the above method as "fileName" it is given in full path (c:/..../your.jar).
What is wrong? Can any people help me?
Thanks very much.
22 years ago
Thanks to all your guys!
22 years ago
The application is running on Server "A", I am working on client machine "B". How to write a file to the directory of local machine (for example, c:\myDoc)?
If using File and FileWriter (or FileOutputStream), it can not work cross network. So file is write to the Server "A" instead of Client machine "B". If using ServletResponse.getOutputStream(), no file directory can be specified.
How can I do that?
22 years ago
The application is running on Server "A", I am working on client machine "B". How to write a file to the directory of local machine (for example, c:\myDoc)?
If using File and FileWriter (or FileOutputStream), it can not work cross network. So file is write to the Server "A" instead of Client machine "B". If using ServletResponse.getOutputStream(), no file directory can be specified.
How can I do that?
Thanks a lot.
22 years ago