ashwin deshpande

Greenhorn
+ Follow
since Jun 14, 2004
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 ashwin deshpande

thanks for the info...
will try it out...
right now i am using

<html:link action='myAction'
paramId="id"
paramName="beanName"
paramProperty="id" >
Edit Information ?
</html:link>

and i have a actionform with name beanName in my request scope and a property called 'id'....and its working fine....

dont want to mend it if its not broken...but will try the link elsewhere...

thanks again...

ashwin
19 years ago
hi,

I am trying to pass 1 parameter thru a html:link, this parameter is set in request scope before the jsp is called...in the page i print out the value of request.getParameter("parameterName"); and it shows up correctly...

i want to pass this parameter ahead when the user clicks on the link...

i tried to do this:
<html:link action='repeatSearch?search=<%=request.getParameter("search")%>' > Search Again </html:link>

but i dont think i can get that working...

is there anyway i could use a html:hidden text field and set that value ? i tried to do that, but was unsuccessfull,...i tried to do it with/without using <html:form> element, again no success.....

one other thing, this parameter is not part of the actionForm and i dont want to add it to the actionForm, just for this purpose....

thanks for reading all this...

ashwin
19 years ago
hi,

Im trying to use ActionMessages in my jsp...

here is the code snippet...

----------------------------------------------
MyActionClass

ActionMessages messages = new ActionMessages();
messages.add("noRecordsFound", new ActionMessags("records.notFound"));
saveMessages(req, messages);

return mapping.getInputForward();
-----------------------------------------------

myJSP.jsp

actually here i tried using
<logic:messagesPresent> tag, <logic:match> tag and <html:messages> tag, but i just cant seem to get it right... i would really appreciate if you could post the correspond jsp code for the above messages...

thanks

ashwin
19 years ago
hi,

I found one of the problems, i had copied the code from a previous (working) jsp, and it had a <javascript formName="someOtherForm" /> entry in it....i removed it from my current page....i still got the "cannot retrieve bean info" error message, so i added the following line

<html:form action="searchLicenses" focus="serialNumber"
name="licenseInfoForm" type="org.....LicenseInfoForm" scope="session" >

after this the jsp page was shown correctly, but after i click the submit button, i got a NullPointerException. In my corresponding ActionClass, i check to see if i receive any "form" in my execute method and all im getting is NULL, i even tried to set the scope="session" in the html:form tag and also in the actionmapping in struts-config.xml.....

i print out a message when the actionform is created and destroyed and when when i was using scope=request, i could see that the form is created before the action is called, but its also destroyed....hence i had tried using session scope....

btw i dont think that the next page searchResults.jsp is causing any error as i get this exception in the execute() method itself, before i can forward to the next page....

here is the new error message:

license info form created .....................
license info form deleted .....................
entering searchlicense action
<Jun 17, 2004 11:16:26 AM PDT> <Error> <HTTP> <BEA-101017> <[ServletContext(id=1
6352912,name=webapp,context-path=/bits)] Root cause of ServletException.
java.lang.NullPointerException
at org.lapd.bits.struts.actions.SearchLicenseAction.executeAction(Search
LicenseAction.java:45)
at org.lapd.bits.struts.actions.ActionBase.execute(ActionBase.java:32)

-ashwin
19 years ago
hi,

thanks for the inputs, i still cant get it to work

i made the changes from <input type="text" /> to <html:text />
my LicenseInfoForm extends ValidatorForm,

is there anyway that i could debug the struts part ?

i have been stuck on this for 2 days now and i feel like im up against a wall....

all help appreciated

-ashwin
19 years ago
hi,

i had thought i had got the hang of struts, but maybe not 100%. here is my relevant code snippets:

struts-config.xml

<form-beans>
<form-bean name="licenseInfoForm" type="...forms.LicenseInfoForm />
</form-beans>

<action-mappings>
<action
path="/searchLicenses"
type="org.....actions.SearchLicenseAction"
name="licenseInfoForm"
scope="session"
validate="false" >
<forward name="success" path="/pages/searchResults.jsp" />
</action>
</action-mappings>

search.jsp

<%@ taglib .... %>
<head>
<html:base />
</head>

<html:form method="POST" action="searchLicenses" focus="serialNumber" >

<TABLE width=400 bgcolor="#FFFFFF" border=0 cellpadding=2 cellspacing=15>
<TR>
<TD colspan=1>Please enter serial number :</TD>
<TD><input type="text" name="serialNumber" maxlength=10 size=12 > </TD>
</TR>
..
...etc


LicenseInfoForm.java
private int serialNumber ;

public int getSerialNumber() { return serialNumber; }

public void setSerialNumber(int serialNumber) { this.serialNumber = serialNumber; }

---------------------
i have other parts working, so i dont think i am making any basic mistakes, but i just dont know what to...

all help appreciated .....

if u want i can post more code...

thanks,

ashwin
19 years ago