Note that there are some explanatory texts on larger screens.

plurals
  1. POPassing data from Controller to jsp
    primarykey
    data
    text
    <p>I basically want to pass data from my controller into my JSP to pass data trough my application. Main idea is to get data per URL and send i to an service method. I want to use it to simply change a password.</p> <p>Controller: </p> <pre><code>@RequestMapping("/passwordSetForm") public String redirectToPasswordForm(@RequestParam(value = "token") String token) { log.debug("+++++token: '{}'",token); return "form"; } </code></pre> <p>Return the form to change the password, identification per token.</p> <p>JSP:</p> <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%&gt; &lt;%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Set Password/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form name="f" action="&lt;%= request.getContextPath() %&gt;/setPassword" method="POST"&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;input class="field" type='text' id="password" name='password' size="20" /&gt; &lt;input type="hidden" name="token" id="token" value="${ token }" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2"&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan='2' align="center"&gt; &lt;input name="submit" type="submit" value="SET" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I want to pass the token trough into the next controller method. But I only getting a variable and not the token value. Am I forgetting an import or something ? Thx for any help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload