RE: DynaActionForm java.lang.ArrayIndexOutOfBoundsException

2004-08-17 Thread Anirudh Jayanth
Try recreating the entire DynaActionForm with a new name(including the
Line[]) and set the new actionform to the Action 
I am guessing that you may not have added the Line[] initially and then
added it later on...

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 18, 2004 10:55 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: DynaActionForm java.lang.ArrayIndexOutOfBoundsException



Thanks Shoaib.

But, after giving the size 100 as : type=com.test.Line[100], it throws
a NullPointerException :

java.lang.NullPointerException: The type for property offerSlotslines is
invalid
at
org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:414)
at
org.apache.struts.action.DynaActionFormClass.newInstance(DynaActionFormC
lass.java:243)
at
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:8
21)
at
org.apache.struts.action.RequestProcessor.processActionForm(RequestProce
ssor.java:364)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
253)
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:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:358)
at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationH
andler.java:294)
at
org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:222)
at
org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:135)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.jav
a:1069)
at
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProc
essor.java:274)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestPr
ocessor.java:455)
at
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Tiles
RequestProcessor.java:320)
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:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:358)
at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationH
andler.java:294)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1807)
at
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationCon
text.java:525)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1757)
at org.mortbay.http.HttpServer.service(HttpServer.java:879)
at
org.mortbay.http.HttpConnection.service(HttpConnection.java:790)
at
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:961)
at
org.mortbay.http.HttpConnection.handle(HttpConnection.java:807)
at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:197
)
at
org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:276)
at
org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:511)


-Original Message-
From: Mohammad Shoaib [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 18, 2004 10:45 AM
To: 'Struts Users Mailing List'
Subject: RE: DynaActionForm java.lang.ArrayIndexOutOfBoundsException


You have to specify the
Size here type=com.test.Line[]

Or whatever is the initial size you specify in your action the zise
should remain less that or equal to that size otherwise you will get
this error.

Regards
Shoaib
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 18, 2004 1:13 PM
To: [EMAIL PROTECTED]
Subject: DynaActionForm java.lang.ArrayIndexOutOfBoundsException


Hi Everyone,


I am using DynaActionForm. It is throwing
ArrayIndexOutOfBoundsException. Not sure what the issue could be.


Can you pls help me.


form-bean name=myForm
type=org.apache.struts.validator.DynaValidatorForm
   form-property name=lines type=com.test.Line[]/
form-property name=lastSlotId type=java.lang.String /
form-property name=campaignId type=java.lang.Integer /
/form-bean


Action mapping is :
action path=/8200/123
type=com.test.myAction
   name=MyForm
scope=session
input=/myJSP.jsp
   forward name=success path=/8200/123.do/
  /action


Thanks  Regds
Ravi





Confidentiality Notice


The information contained in this electronic message and any attachments
to this 

RE: NEWBIE - How to submit form and display results in popup window with no browser decorations.

2004-06-29 Thread Anirudh Jayanth
You could use a javascript function to achieve this..

function Help(document,val) {
window.open('Action.do_contextId='+val,'win','toolbar=no,location=no,di
rectories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=400,
height=210,left=0,top=0')
}

In the action retrieve the context id as
request.getParameter(_contextId);
The dispatch logic then resides in the action


Anirudh Jayanth
SysArris Software 
120A, Elephant Rock Road, 
3rd Block, Jayanagar, 
Bangalore - 560011 
Tel: 6655165 / 052 [ ext - 243 ] 
[EMAIL PROTECTED] 


-Original Message-
From: Adam Lipscombe [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 29, 2004 5:16 PM
To: 'Struts Users Mailing List'
Subject: NEWBIE - How to submit form and display results in popup window
with no browser decorations.


Folks,


From browsing the list archive I can see that this sort of questions 
gets
asked frequently. I looked at the solutions but none seem, to fit my
case:


I am trying to implement a popup window context-sensitive help system
for a struts app.

My solution so far is to have a help button in its own form, and the
form has a hidden contextID field. This contextID is stored in the
ActionForm and allows the Action to decide which help screen to display.

This is easy enough do if one just wants a new window (using
target=WindowName in the html:form tag). However the new window has
all the normal browser buttons etc.

e.g.:


 html:form action=/help method=POST target=HelpWindow 
   html:hidden property=context value=homePage /
map name=Map
  area shape=rect coords=2,0,50,13 href= 
/map
  /html:form


Critically, I want to display the help in a popup window that has no
browser decorations (navigation buttons, text labels  etc). I need to
specify the width and height of the popup.



I looked at Ted Husted's solution Use Struts JSP Tags to create dynamic
JavaScripts (http://husted.com/struts/tips/010.htm). 
If I understand this solution correctly, it uses html:rewrite's to call
global forwards that pass parameters to a JSP.  In my case this could
work, but seems to imply that some dispatch logic (i.e. which help page
to display, dependent on the context) resides in the receiving JSP. 
I would rather that the dispatch logic resides in an Action.




How can this be done?


TIA - Adam


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: NEWBIE - How to submit form and display results in popup window with no browser decorations.

2004-06-29 Thread Anirudh Jayanth
The help function is for the button onclick method... Or for a a href
tag...
You don't need a form for this approach.. All you need to do is to pass
the contextId to the action which you can pass as a request parameter. I
have used this technique successfully to pass params..
I guess that if you were to submit the form it would cause the current
page to submit aswell.. Which is why we will have to avoid that.
(Correct me if I am wrong on this)

Regards,

Anirudh Jayanth
SysArris Software 
120A, Elephant Rock Road, 
3rd Block, Jayanagar, 
Bangalore - 560011 
Tel: 6655165 / 052 [ ext - 243 ] 
[EMAIL PROTECTED] 


-Original Message-
From: Adam Lipscombe [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 29, 2004 5:42 PM
To: 'Struts Users Mailing List'
Subject: RE: NEWBIE - How to submit form and display results in popup
window with no browser decorations.


Thanks Anirudh,


Do you mean that the form should have no ActionForm associated with it?
(Currently I am using an ActionForm to pass the value of the contextID)

I did not know that one could pass params to an action with the
action.do?p1=valuep2=value technique.


Where does one place the call to the Help() function?
In the form onsubmit() method? Or on the button onclick() method? 

Should it be like this:

html:form action=/help method=POST target=HelpWindow
onsubmit=javascript:Help() 
  html:hidden property=contextID value=homePage /
  map name=Map
area shape=rect coords=2,0,50,13 href=
onclick=javascript:document.helpActionForm.submit()
  /map
/html:form



TIA -Adam




-Original Message-
From: Anirudh Jayanth [mailto:[EMAIL PROTECTED] 
Sent: 29 June 2004 13:19
To: 'Struts Users Mailing List'
Subject: RE: NEWBIE - How to submit form and display results in popup
window with no browser decorations.


You could use a javascript function to achieve this..

function Help(document,val) {
window.open('Action.do_contextId='+val,'win','toolbar=no,location=no,di
rectories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=400,
height=210,left=0,top=0')
}

In the action retrieve the context id as
request.getParameter(_contextId);
The dispatch logic then resides in the action


Anirudh Jayanth
SysArris Software 
120A, Elephant Rock Road, 
3rd Block, Jayanagar, 
Bangalore - 560011 
Tel: 6655165 / 052 [ ext - 243 ] 
[EMAIL PROTECTED] 


-Original Message-
From: Adam Lipscombe [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 29, 2004 5:16 PM
To: 'Struts Users Mailing List'
Subject: NEWBIE - How to submit form and display results in popup window
with no browser decorations.


Folks,


From browsing the list archive I can see that this sort of questions 
gets
asked frequently. I looked at the solutions but none seem, to fit my
case:


I am trying to implement a popup window context-sensitive help system
for a struts app.

My solution so far is to have a help button in its own form, and the
form has a hidden contextID field. This contextID is stored in the
ActionForm and allows the Action to decide which help screen to display.

This is easy enough do if one just wants a new window (using
target=WindowName in the html:form tag). However the new window has
all the normal browser buttons etc.

e.g.:


 html:form action=/help method=POST target=HelpWindow 
   html:hidden property=context value=homePage /
map name=Map
  area shape=rect coords=2,0,50,13 href= 
/map
  /html:form


Critically, I want to display the help in a popup window that has no
browser decorations (navigation buttons, text labels  etc). I need to
specify the width and height of the popup.



I looked at Ted Husted's solution Use Struts JSP Tags to create dynamic
JavaScripts (http://husted.com/struts/tips/010.htm). 
If I understand this solution correctly, it uses html:rewrite's to call
global forwards that pass parameters to a JSP.  In my case this could
work, but seems to imply that some dispatch logic (i.e. which help page
to display, dependent on the context) resides in the receiving JSP. 
I would rather that the dispatch logic resides in an Action.




How can this be done?


TIA - Adam


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]