Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Amith Mahalingaiah

Greenhorn
+ Follow
since Jul 12, 2004
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 Amith Mahalingaiah

hi

i have a requirement where the user can dynamically add textboxes.
i have captured the user given values for these textboxes using a String array in the actionForm.

the form is shown below.....

public class ObligationMaintananceActionForm extends ValidatorForm {
private String []name= null;
}

the values are being set into the array in the form properly.

now, if i want to validate the values populated in the String array, how should i go about?

Awaiting an early reply. I am i need of it very badly.

-Amith
17 years ago
yes you can.

you can do with the help of DispatchAction or LookupDispatchAction built-in classes provided by struts.
17 years ago
hi,

i have a requirement where we need to use two Controllers (one for each module) in our project.

my web.xml looks like this..........

<?xml version="1.0" encoding="UTF-8"?>
<!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>
<servlet>
<servlet-name>controller1</servlet-name>
<servlet-class>com.test.struts.Controller1</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/config1.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

<servlet>
<servlet-name>controller2</servlet-name>
<servlet-class>com.test.struts.Controller2</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/config2.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>controller1</servlet-name>
<url-pattern>/controller1/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>controller2</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>/bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/logic</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
</web-app>

..both controller1 and controller2 extend ActionServlet. when using controller2 i use the URL
http://localhost:9080/MultipleControllers/Welcome.do

(the struts-config snippet corresponding to Welcome.do is shown below
)

<action

path="/Welcome"

type="org.apache.struts.actions.ForwardAction"

parameter="/pages/Welcome.jsp"/>


and it works fine.....next i want to use the controller1 and i use the url

http://localhost:9080/MultipleControllers/controller1/WelcomePage

(the struts-config snippet corresponding to "WelcomePage" is shown below
)
<action

path="/WelcomePage"

type="org.apache.struts.actions.ForwardAction"

parameter="/WorkFlow/pages/WorkFlowWelcome.jsp"/>


..now it gives me an error

org.apache.struts.action.RequestProcessor Invalid path /WorkFlow/WelcomePage was requested

i dont know why this error comes up.

i also wanted to clear some of my doubts connected with the same.

1)Is it possible to have Multiple Controllers in a single web-applicaion?
(both these controllers are extended from the ActionServlet)

2)if Yes, can you please post some sample code which would help me in understanding the same?

3)Can this Muliple Controller concept be used along with the struts modules?
(or to rephrase...Can the struts modules concept work with more than one Controller?)

I am stuck with this for quite some time. If any of you have faced similar situations...please guide me or help me with some code snippets.

THanks in advance
-AMith
17 years ago
Hi,

i am accessing WSAD remotely. Whenever i try to run an EJB on the server..the server tries to launch the test client and while doing so....it gives me the following exception.

If any one of you have faced similar problems, please suggest some remedial steps.

Any help in this regard would be appreciated.

Thanks
-Amith

Error page exception
The server cannot use the error page specified for your application to handle the Original Exception printed below. Please see the Error Page Exception below for a description of the problem with the specified error page.


Original Exception:
Error Message: \viewstore\dm0001\T1405BK\workspace5\.metadata\.plugins\com.ibm.etools.server.core\tmp1\cache\localhost\server1\IBMUTC\UTC.war\_index.java (The system cannot find the path specified)
Error Code: 404
Target Servlet: JSP 1.2 Processor
Error Stack:
com.ibm.ws.webcontainer.webapp.WebAppErrorReport: \viewstore\dm0001\T1405BK\workspace5\.metadata\.plugins\com.ibm.etools.server.core\tmp1\cache\localhost\server1\IBMUTC\UTC.war\_index.java (The system cannot find the path specified)
at com.ibm.ws.webcontainer.srt.SRTServletResponseContext.sendError(SRTServletResponseContext.java:162)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:621)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:379)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:669)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:767)
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:983)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.etools.utc.servlet.UTCServlet.forward(UTCServlet.java:65)
at com.ibm.etools.utc.servlet.JNDILookupServlet.lookup(JNDILookupServlet.java:95)
at com.ibm.etools.utc.servlet.JNDILookupServlet.doGet(JNDILookupServlet.java:37)
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:983)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
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.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
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:672)




Error Page Exception:
Error Message: \viewstore\dm0001\T1405BK\workspace5\.metadata\.plugins\com.ibm.etools.server.core\tmp1\cache\localhost\server1\IBMUTC\UTC.war\_error.java (The system cannot find the path specified)
Error Code: 404
Target Servlet: JSP 1.2 Processor
Error Stack:
com.ibm.ws.webcontainer.webapp.WebAppErrorReport: \viewstore\dm0001\T1405BK\workspace5\.metadata\.plugins\com.ibm.etools.server.core\tmp1\cache\localhost\server1\IBMUTC\UTC.war\_error.java (The system cannot find the path specified)
at com.ibm.ws.webcontainer.srt.SRTServletResponseContext.sendError(SRTServletResponseContext.java:162)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:621)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:379)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:669)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:767)
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.ServicingServletState.service(StrictLifecycleServlet.java:333)
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:983)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.webapp.WebApp.handleError(WebApp.java:1035)
at com.ibm.ws.webcontainer.webapp.WebApp.sendError(WebApp.java:897)
at com.ibm.ws.webcontainer.srt.SRTServletResponseContext.sendError(SRTServletResponseContext.java:170)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:621)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:379)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:669)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:767)
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:983)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.etools.utc.servlet.UTCServlet.forward(UTCServlet.java:65)
at com.ibm.etools.utc.servlet.JNDILookupServlet.lookup(JNDILookupServlet.java:95)
at com.ibm.etools.utc.servlet.JNDILookupServlet.doGet(JNDILookupServlet.java:37)
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:983)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
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.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
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:672)
17 years ago
hi,

a word file stored in a server will be opened by clients on their IE. This word file is opened by firing a http request
similar to http://ip of machine/contextName/folderName/filename.doc

now i have a requirement where the person updates the word file and clicks save. The updated word file should now be there in the place of the old file.
i cannot upload the file again after the change. when i say save (may be a button or the "save" button) in the word file.

is there any way how i can accomplish this.?? Any suggestions are always welcome.

thanks
Amith
17 years ago
Hi
In a jsp, i have a form which has an array of textboxes called "routerName".

my form tag looks like this.......

<html:form action="/AffiliateSave" method="post" focus="routerName">

|_________|
|_________|
|_________|
|_________|
|_________|
|_________|
|_________|

i have an array of textboxes as shown above. When the jsp is served, i want the focus to be on the first textbox.

i tried giving focus="routerName"........then i got a javascript error which said "Object doesn't support this property or method"

then i tried giving focus="routerName[0]"........then i got a javascript error which said "focusControl.type is null or not an object".

i think the second option is correct but i am missing something.

Any info on this regard would be appreciated.

Thanks
Amith
17 years ago
hi guys,

i just wanted to know whether we can have a <html:text> tag without a <html:form> tag.

for example
Index.jsp

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<html:html>

<html:text property="uid"/>
<html:text property="uid"/>
<html:submit property="submit"/>

</html:html>
--------------------------------------------------------------------------
web.xml

<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>

---------------------------------------------------------------------------
struts-config.xml

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!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>

</struts-config>
----------------------------------------------------------------------------

when i run the index.jsp without the <html:form> tag, it gives me an error

org.apache.jasper.JasperException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope


to counter this exception i modified my jsp to

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<html:html>
<html:form action="">
<html:text property="uid"/>
<html:text property="uid"/>
<html:submit property="submit"/>
</html:form>
</html:html>

..........now i get an error

org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection

....i understand what the error means. But is there any way to just view a jsp page using the <html> tags provided by struts without using any forms, formbeans, and Action.

i just want to use the taglib <html> which struts provide.

If the answer is that i cannot use <html:text> without a <html:form> outside it....why is it so?

-Amith
17 years ago