Announcement Announcement Module
Collapse
No announcement yet.
Problem with multi params in url Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with multi params in url

    hey there ..

    i want to sent 3 params to the controller with the following:

    HTML Code:
    <li><a href="result?name1=thor&name2=hulk&name3=loki">SMTH</a></li>
    the controller:

    Code:
    @Controller
    @RequestMapping(value="/result")
    public class SmthController {
    	
    	@RequestMapping(method=RequestMethod.GET)
    	public String dosmth(HttpServletRequest request) {
    		
    		String one = request.getParameter("name1");
    		String two = request.getParameter("name2");
    		String three = request.getParameter("name3");
    		
    		
    		JOptionPane.showMessageDialog(null,
    			    " Param 1 is:" +one +" \n Param 2 is: " +two +" \n Param 3 is: " +three);
    		
    		return "redirect:/";
    	}
    }
    But i get this error:
    The entity name must immediately follow the '&' in the entity reference.

    It works fine for only one param ..

    am i doing smth wrong ? .. i tried &amp; .. but it doest work aswell

    anyone has an idea ?

  • #2
    &amp;amp; did the trick ..

    HTML Code:
    <li><a href="result?name1=thor&amp;amp;name2=hulk&amp;amp;name3=loki">SMTH</a></li>

    Comment

    Working...
    X