[Sample.vm]
|
[Welcome.vm]
<html> <head> <title>Welcome</title> <BASE href="$link.baseRef"> </head> <body bgcolor="#ffffff"> #if ($logonActionForm) <H3>Welcome $logonActionForm.username!</H3> #else <H3>Welcome World!</H3> #end $!errors.msgs() </body> </html> |
[Logon.vm]
<HTML> <HEAD> <TITLE>Sign in, Please!</TITLE> <script language="javascript" src="validate.js"></script> </HEAD> <BODY> 테스트 중 $!errors.msgs() <FORM name="logonForm" method="POST" action="$link.setAction('/logonAction')" onsubmit="return validate(this);"> <TABLE border="0" width="100%"> <TR> <TH align="right">Username:</TH> <TD align="left"><INPUT type="text" name="username" dispName="username" notNull value="$!logonForm.username"></TD> </TR> <TR> <TH align="right">Password:</TH> <TD align="left"><INPUT type="password" name="password" dispName="password" notNull value="$!logonForm.password"></TD> </TR> <TR> <TD align="right"><INPUT type="submit" value="Submit" name="submit"></TD> <TD align="left"><INPUT type="submit" value="reset" value="Reset" name="reset"></TD> </TR> </TABLE> </BODY> </HTML> |
[struts-config.xml]
<form-beans> <form-bean name="logonForm" type="com.jumyung.sample.form.LogonActionForm" /> </form-beans> <action-mappings> <action input="/Logon.vm" name="logonForm" path="/logonAction" scope="session" type="com.jumyung.sample.action.LogonAction" validate="true" > <forward name="success" path="/Welcome.vm"/> </action> </action-mappings> |
[결과]
|
반응형
'Frontend > velocity' 카테고리의 다른 글
Velocity II - Development Configuration | by Hoon (0) | 2010.12.23 |
---|---|
Velocity 개요, 실행원리 | by Hoon (0) | 2010.12.23 |
댓글