File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes Spring and Filtering Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Spring and Filtering" Watch "Spring and Filtering" New topic
Author

Spring and Filtering

mia mia
Greenhorn

Joined: Apr 15, 2005
Posts: 1
new to spring ..

i need a expert suggestion on how to implement the following scenariao ..

i have listing form with paging and filtering ..

both filter fields and listing is on the same page ..

presently i am using AbstractCommandController
and storing filter fields in session..
doing some logic in handle method to populate lists
and sessionScope.blah.blah to show up the filter fields in jsp

if the user enter the correct data for filtering no probs ..
but an error is thrown if the user enters invalid data ..

i need to know how to show an error next to the fields if one has entered invalid data ..

i used a bean validator and the field is getting validated ..

then i tried to bind the values into jsp but
the following error was thrown

javax.servlet.jsp.JspTagException: Neither Errors instance nor plain target object for bean name 'filter' available as request attribute
at org.springframework.web.servlet.tags.BindTag.doStartTagInternal(BindTag.java:108) .........

this is my bean
<bean id="cidController" class="com.ompay.om.web.CidController">
<property name="commandName"><value>filter</value></property>
<property name="commandClass"><value>com.ompay.om.domain.logic.Filter</value></property>
<property name="validator"><ref bean="beanValidator"/></property>
<property name="om">
<ref bean="om"/>
</property>
</bean>


and how i bind
<spring:bind path="filter.id">
<input type="text" name="<core ut value="${status.expression}"/>" size="15" maxlength="15" value="<core ut value="${status.value}"/>" />
<span class="error"> <core ut value="${status.errorMessage}"/></span>
</spring:bind>

<spring:bind path="filter.type">
<input type="text" name="<core ut value="${status.expression}"/>" size="15" maxlength="15" value="<core ut value="${status.value}"/>" />
<span class="error"> <core ut value="${status.errorMessage}"/></span>
</spring:bind>

i am very new to spring and any help will be greatly appreciated ..
i am also doubtful that is this the way it should be done ..


thanx in advance
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring and Filtering