mia mia

Greenhorn
+ Follow
since Apr 15, 2005
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 mia mia

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