Post Method problem with VaadinRequest

Hi.
I recently started programming with vaadin and have a problem with this code:

this is a .jsp page with a form


<form method="post" action="http://localhost:8081/onlineHelperServices/" 
enctype="multipart/form-data">
   <input name="chain" value="4_2_2">
   <button type="submit">Send</button>
</form>

and this is the code in Vaadin that the jsp page redirects with the submit button


public class MyVaadinUI extends UI     
{	
    @Override
    protected void init(final VaadinRequest request) {    	
    	final VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        setContent(layout);
        String result = request.getParameter("chain");
        layout.addComponent(new Label(result));        
    }
}

The problem is that if I use

POST

method

request.getParameter(“chain”) == null

but if I use

GET

method

request.getParameter(“chain”) == “4_2_2”

Can anyone tell me what’s wrong with my code?? because I need to use POST method.

Thanks.

Why would you want to mix tools in this way?

If you’re using JSPs, then just use JSPs and don’t worry about it.

If you’re using Vaadin, then Vaadin is handling the form and will deal w/ the issues.

Vaadin is not a server side framework on it’s own - it uses a lot (in fact almost all) AJAX for communicating between the browser and the server, and trying to mix things in this way is doomed to failure.

Thanks for your answer Dave. I need to communicate an app not coded in vaadin (JAVA+FLEX) with a new vaadin app sending some not invisible parameters (from the Flex app I need to open a browser window containing the vaadin app). So I’m trying with a form with POST method. If someone have a better idea I’ll be grateful.

Hi L S B,

Were you able to achieve this ? I too am facing a similar issue.