History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: STS-588
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Ben Gunter
Reporter: Michael Day
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Stripes

NameBasedActionResolver throws exception for empty action name in URL

Created: 03/Jul/08 06:57 PM   Updated: 23/Dec/08 08:58 AM
Component/s: ActionBean Dispatching
Affects Version/s: Release 1.5.1
Fix Version/s: Release 1.6, Release 1.5.1


 Description  « Hide
I have /action/* mapped to Stripes, and if someone requests the URL "/action/", I get the following exception. I believe NameBasedActionResolver should be checking the length before name.charAt(0).

java.lang.StringIndexOutOfBoundsException: String index out of range: 0
        at java.lang.String.charAt(String.java:558)
        at net.sourceforge.stripes.controller.NameBasedActionResolver.findView(NameBasedActionResolver.java:343)
        at net.sourceforge.stripes.controller.NameBasedActionResolver.handleActionBeanNotFound(NameBasedActionResolver.java:289)
        at net.sourceforge.stripes.controller.NameBasedActionResolver.getActionBean(NameBasedActionResolver.java:264)
        at net.sourceforge.stripes.controller.AnnotatedClassActionResolver.getActionBean(AnnotatedClassActionResolver.java:279)
        at net.sourceforge.stripes.controller.DispatcherHelper$1.intercept(DispatcherHelper.java:106)
        at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158)
        at net.sourceforge.stripes.integration.spring.SpringInterceptor.intercept(SpringInterceptor.java:64)
        at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)
        at net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113)
        at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)
        at net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74)
        at net.sourceforge.stripes.controller.DispatcherHelper.resolveActionBean(DispatcherHelper.java:102)
        at net.sourceforge.stripes.controller.DispatcherServlet.resolveActionBean(DispatcherServlet.java:245)
        at net.sourceforge.stripes.controller.DispatcherServlet.doPost(DispatcherServlet.java:148)
        at net.sourceforge.stripes.controller.DispatcherServlet.doGet(DispatcherServlet.java:67)
...

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order

Ben Gunter - 23/Dec/08 08:58 AM
This actually applied to all URLs ending in "/". Fixed for 1.5.1.