---
title: "freemarker 怎 怎么获取用户名和密码并 提交到  .action 类？"
author: "jayjunyu"
date: "2008-07-20T09:20:58Z"
tags: []
categories: ["企业架构"]
slug: "freemarker-action"
draft: false
lastmod: "2008-07-20T09:20:58Z"
id: 216649
url: "https://jayjunyu.iteye.com/blog/216649"
---

如题，， 谢谢帮忙！！

 .ftl 内容：

 

```
<table width="600" border="1" cellpadding="0" cellspacing="0">
				<tr align="center">
					<td width="50%">
						登陆名：
					</td>
					<td align="center">
						<input type="text" name="u_name" />
					</td>
				</tr>
				<tr>
					<td align="center">
						密码：
					</td>
					<td align="center">
						<input type="password" name="u_pwd" />
					</td>
				</tr>
				<tr>
					<td align="center">
						<input type="submit" name="login_submit" value="登" />
					</td>
					<td align="center">
						<input type="button" name="login_cancel" value="取" />
					</td>
				</tr>
			</table>
```

 

 

.action 中的：

 

```
public String execute() {

		// 获取登陆用户名
		String username = request.getParameter("u_name");

		
		System.out.println("用户名：..........."+username);
		
		// 获取登陆名
		UserstickDAO userdao = new UserstickDAO();
		boolean flg = userdao.lookusername(username);

		System.out.println("true&&false............."+flg);
		
		if (flg) {
			return "lun_success";
		} else {
			return "lun_failth";
		}
	}
```

 

 

 

应该改哪里的代码？

 

 

还是应该改  struts.xml 中的？