package com.bing.login.web;
import org.apache.struts2.osgi.interceptor.BundleContextAware;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import com.bing.services.IBulletinService;
import com.bing.test.entity.Bulletin;
import com.opensymphony.xwork2.ActionSupport;
public class LoginAction extends ActionSupport implements BundleContextAware {
private BundleContext bundleContext;
private String userName;
private String password;
public String loginExec() {
System.out.println("name-->" + userName);
System.out.println("password-->" + password);
ServiceReference ref = bundleContext
.getServiceReference(IBulletinService.class.getName());
IBulletinService bullService = bundleContext.getService(ref);
Bulletin bull = new Bulletin();
bull.setId(1);
bull.setAuthor("bing");
bull.setContent("wangbing");
bull.setWritetime("now");
bullService.addBulletin(bull);
if (userName.equals("bing") && password.equals("123")) {
return SUCCESS;
} else {
return ERROR;
}
}
public String loginPageShow() {
return SUCCESS;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public void setBundleContext(BundleContext buncontext) {
this.bundleContext = buncontext;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
struts2-hibernate-bundle.zip (55个子文件)
com.example.login.web
META-INF
MANIFEST.MF 548B
build.properties 80B
src
com
example
login
web
Activator.java 728B
bing
login
web
LoginAction.java 1KB
struts.xml 620B
login
loginresult.ftl 287B
login.ftl 469B
bin
com
example
login
web
Activator.class 784B
bing
login
web
LoginAction.class 2KB
struts.xml 620B
login
loginresult.ftl 287B
login.ftl 469B
.classpath 376B
.settings
org.eclipse.core.resources.prefs 99B
org.eclipse.pde.core.prefs 152B
org.eclipse.jdt.core.prefs 395B
.project 682B
webapp
src
ehcache.xml 3KB
struts.xml 339B
bundles
3
hostHiberExtension_1.0.0.201205211454.jar 6KB
hostHiberbundle_1.0.0.201205211454.jar 4.89MB
2
host-Register-api_1.0.0.201205161638.jar 4KB
hostRegister_1.0.0.201205161638.jar 302KB
struts2-osgi-admin-bundle-2.1.8.1.jar 91KB
.classpath 599B
build
.settings
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.common.project.facet.core.xml 305B
org.eclipse.core.resources.prefs 88B
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.wst.common.component 472B
.jsdtscope 503B
org.eclipse.jdt.core.prefs 395B
WebContent
META-INF
MANIFEST.MF 457B
index.jsp 373B
WEB-INF
classes
ehcache.xml 3KB
struts.xml 339B
bundles
3
hostHiberExtension_1.0.0.201205211454.jar 6KB
hostHiberbundle_1.0.0.201205211454.jar 4.89MB
2
host-Register-api_1.0.0.201205161638.jar 4KB
hostRegister_1.0.0.201205161638.jar 302KB
struts2-osgi-admin-bundle-2.1.8.1.jar 91KB
lib
velocity-tools-1.3.jar 132KB
xwork-core-2.1.6.jar 1.49MB
velocity-1.5.jar 383KB
commons-fileupload-1.2.1.jar 56KB
freemarker-2.3.15.jar 859KB
struts2-core-2.1.8.1.jar 738KB
struts2-osgi-plugin-2.1.8.1.jar 38KB
ognl-2.7.3.jar 234KB
commons-io-1.3.2.jar 86KB
org.apache.felix.shell-1.0.2.jar 50KB
org.apache.felix.main-1.4.1.jar 361KB
ehcache.jar 46KB
web.xml 1KB
.project 1KB
共 55 条
- 1
BingDuang
- 粉丝: 29
- 资源: 76
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页