This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!

Sam Mites

Greenhorn
+ Follow
since Nov 27, 2005
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 Sam Mites

To make the screen not to be cached.. add this in the end of the display action just before forwarding...............

response.addHeader("Pragma","no-cache");
response.addIntHeader("Expires",-1);
response.addHeader("Cache-Control","no-cache, must-revalidate");
11 years ago
JSP
I am sorry that i am not able to understand it fully...can u plzz elaborate a bit...
What i think is that it can have a return type of type object...
13 years ago
Hi All.......
This question have been bugging me for quite a long time..wh constructors have no return type?Coz..a constructor returns a object of its Class.......so will it be right to say that a constructor have a return type "Object"???


Thanks and regards

Sam
13 years ago
Hi,
I was going through java api documentation, and I saw the
Interface Collection<E>, Interface Iterable<T> etc. what do <E> and <T> represents here ? and what is the context of their usage?

Thanks in advance.
13 years ago
Hi,
When ever i upload a file, i use encryption type as multipart/form-data in the form. But that way the form bean isn't get populated and the request.getParameter do not work. But by using request.getAttribute i am able to get the values in form. Why is this so?? (Isn't struts have anything in place to populate form beans through reflection when encryption type is multipart/form-data?)
13 years ago
plz refer to the above code...

When i run the server in the debug mode...in case of enctype="multipart/form-data" the form bean is not getting called. the control was directly going to the action class. Henct the form bean data were not populated and i am not able to access the data.

What may be the reason behind the action form not getting called??

when i am running this code without enctype="multipart/form-data" then every thing is ok and the form bean was called before the control goes to the acton class!!!

Thanks and regards
13 years ago
Hi Merrill,

Thank u very much for the files. I went theough them. I still cant able to find the flaw in my code..

here are my sample code...the jsp

<html:form action="/protect/xccManageSolutionComponentsAdd.wss" method="post" enctype="multipart/form-data">
<!--here i am uploading the files-->
<table>
<tr>
<td width="30%">Add CFReport:</td>
<td width="30%" colspan="3"><html:file property="cfReport" size="50" /></td>
<td> </td>
</tr>
<tr>
<td width="25%">Add SEO csv file:</td>
<td width="30%" colspan="3"><html:file property="seoCsvFile" size="50" /></td>
</tr>
<!--here are my text fields -->
<tr>
<table>
<tr>
<td> Type : <html:text property="mesType" size="8" />  </td>
<td> Model :<html:text property="mesModel" size="8" />  </td>
<td> Feature/RPQ : <html:text property="mesFeature" size="12" /></td>
</tr>
</table>
</tr>
<tr>
<td align="right" colspan="5"><span class="button-gray">
<html:submit value="Add" /> </span></td>
</tr>
</table>
</html:form>

here is my form bean

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.*;
import org.apache.struts.upload.FormFile;
public class XCCManageSolutionComponentsForm extends ActionForm
{
private FormFile cfReport;
private String mesFeature;
private String mesModel;
private String mesType;
private FormFile seoCsvFile;
public FormFile getCfReport()
{
return cfReport;
}
public String getMesFeature()
{
return mesFeature;
}
public String getMesModel()
{
return mesModel;
}
public String getMesType()
{
return mesType;
}
public String getSearchSeo()
{
return searchSeo;
}
public FormFile getSeoCsvFile()
{
return seoCsvFile;
}
public void setCfReport(FormFile cfReport)
{
this.cfReport = cfReport;
}
public void setMesFeature(String mesFeature)
{
this.mesFeature = mesFeature;
}
public void setMesModel(String mesModel)
{
this.mesModel = mesModel;
}
public void setMesType(String mesType)
{
this.mesType = mesType;
}
public void setSeoCsvFile(FormFile seoCsvFile)
{
this.seoCsvFile = seoCsvFile;
}

}

does the jsp and the form bean need change..???

thanks and regards
13 years ago
Hi Merrill,
I have few more properties which are decleared as Collection and FormFile needed for loading files. Will these datatypes affect?

Thank you
13 years ago
Description of the problem:
I have a form which will display rows (Eg 100) with two columns ("vehicleDescription" and "leaseAmount" ). This form should display empty (unchecked) boxes for all the 100 rows on left side. This form has a "Delete" button. Whenever a user wants to delete some displayed rows, user selects check boxes associated with that rows. When the user clicks the Delete button, only those rows with checked boxes, should be retrieved in action class to be passed to delete method.



This is what I have in jsp page
<logic:iterate id = "vehicleLeaseListrowid" name="vehicleLeaseList"
scope = "request" type ="com.lvm.vehicle.server.data.VehiclesLeaseValueBean">
<tr>
<td><html:multibox property="selections"><bean:write name="vehicleLeaseListrowid" property="vehicleId"/></html:multibox></td>
<td class="lblBlk1"><bean:write name = "vehicleLeaseListrowid" property = "vehicleDescription"/></td>
<td class="lblBlk1"><bean:write name = "vehicleLeaseListrowid" property = "leaseAmount"/></td>
</tr>



This is what I have in actionform
private String[] selections = {};

public void setSelections(String[] selections){
this.selections = selections;
}

public String[] getSelections(){
return this.selections;
}



This is what I have in reset method
selections = null;



This is the exception error I am facing:
SRVE0026E: [Servlet Error]-[BeanUtils.populate]: java.lang.IllegalArgumentException: argument type mismatch
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1650)
at org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1545)
at org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1574)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:919)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:726)


Please let me know if any more information is needed??
Can some body please help me with a solution??

Thank You
[ December 10, 2005: Message edited by: Sam Mites ]
13 years ago
Hi Merrill,
I studied it, and doing the same thing.but still I am getting the same problem.Can u supply me with some sample code.

thanks and regards
13 years ago
Hi;
the action form fields are not getting populated while using <html:form enctype="multipart/form-data"> whils uploading files. What may be the probable causes for the faliure.

Thanks
13 years ago
I am using struts and in my jsp i am using the tag <html:form>in my jsp where i am using attribute enctype="multipart/form-data" coz i gotta upload a file. along with that i also have a text field in the same html form. So because of the enctype tag, the text field is also getting encrypted and my actionform is not getting populated with the text field value and hence my action class is not performing the desired operation. How to handle this problem when my html form is having both "file" and "text" fields.
13 years ago
JSP
I am using <html:form>in my jsp where i am using attribute enctype="multipart/form-data" coz i gotta upload a file. along with that i also have a text field in the same html form. So because of the enctype tag, the text field is also getting encrypted and my actionform is not getting populated with the text field value and hence my action class is not performing the desired operation. How to handle this problem when my html form is having both "file" and "text" fields.


regards..

[ EJFH: See this. ]

[ December 05, 2005: Message edited by: Ernest Friedman-Hill ]

[ December 05, 2005: Message edited by: Sam Mites ]
[ December 05, 2005: Message edited by: Sam Mites ]
13 years ago
are application context and servlet context are different? if yes how?
13 years ago
Are application context and servlet context are same or different?
13 years ago