Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8748167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:28:42+00:00 2026-06-13T12:28:42+00:00

How to prevent exception, if requestParameters.sortBy is passed as string ( java.lang.NumberFormatException ) or

  • 0

How to prevent exception,
if requestParameters.sortBy is passed as string (java.lang.NumberFormatException) or is missing (java.lang.NullPointerException)?

<view-state id="journeySearch" model="journeyForm">

     ...

    <transition on="sort">
        <set name="journeyCriteria.sortBy" value="requestParameters.sortBy" type="int" />
        <evaluate expression="bookingService.searchJourneys(journeyCriteria)" result="viewScope.journeys" /> 
    </transition>
</view-state>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:28:42+00:00Added an answer on June 13, 2026 at 12:28 pm

    requestParameters.sortBy will be null if it doesn’t exist, but it should not throw a NullPointerException

    about the NumberFormatException, you could use something like that:

    <global-transitions>
        <transition on-exception="java.lang.NumberFormatException" to=""/>
    </global-transitions>
    

    you could also implement your own exception-handler and use it with <exception-handler bean=""/> you can use it at the flow or state level.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I prevent caching on exception? I have this action: caches_page :index ...
I have a exception to prevent inserting same records on my oracle. If a
I'm using Kohana 2. I would like to catch a database exception to prevent
Is there any way to prevent o.GetType() from throwing an exception when called on
I often do this when necessary to prevent a null pointer exception : //
I am trying to prevent from having to escape apostrophes in my string variables
Following code should throw exception to prevent adding duplicate collection item. ICollection<T> collection =
I am trying to prevent an instance from throwing an exception if a method
In java I need to prevent Level1 class (look at following sample code) from
How do I prevent a NullPointerException in this code when I push the cancel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.