[英]Retrieving a parameter from GSP in Controller, Grails
我的 demo.gsp 文件中確實有此代碼。 但我是 grails 的新手,我不太清楚如何檢索 Controller 上的輸入值來驗證它,例如“inputResult=="hi" 然后 ok else bad"。
<g:form action='${postUrl}' method='post' id='loginForm' class='cssform' autocomplete='off'>
<p>
<label for="password">
<g:message code="access.code"/>:
</label>
</p>
<p>
<input name="j_password" class="loghominput" id="password" type="password"/>
</p>
<div class="greenbutton2">
<a href="#" onclick="document.getElementById('loginForm').submit(); return false">
<g:message code="home.enter"/></a><input type="submit" style="display:none" value="Enter"/>
</div>
</g:form>
我的 Controller 是這樣的。
class AskDemoController {
def demo = {
}
}
謝謝!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.