Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Spring and Filtering

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!