How do I immediately load another page in JSP/Spring? -


i'm not experienced in jsp. have application, uses spring framework, search. show these results in jsp page.

when search returns 1 item, want jump page shows information item.

is possible in jsp/spring? i've seen tags like:

<c:redirect url="/somepage.html"/> 

that's jsp file. want (this naive bit of code)...

<c:when test="${cmd.totalresults = 1}">     <c:redirect url="/loaditeminfo.html?id=someid"/> </c:when> 

thanks in advance advice , help! can omit regarding parameters involved; can figure out. i'm asking making happen.

  1. page loads.
  2. page sees there 1 result.
  3. page goes page result, happens anyway when user clicks search result. saves click.

you should check number of items logic in spring controller not in jsp file.

inside spring controller may have this:

if(items.size==1){  //query items[0] info  return new modelandview("iteminfo",model); } else{    return new modelandview("listofitems",model); } 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -