SSH框架搭建过程中遇到jsp页面的值无法传到action中的情况,求大神解答

实体类

package ssh.domain;

import com.sun.javafx.beans.IDProperty;

import javax.persistence.Id;

public class Product {
    private int pid;
    private String pname;
    private double price;


    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getPname() {
        return pname;
    }

    public void setPname(String pname) {
        this.pname = pname;
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }
}

jsp

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>商品管理</title>
</head>
<body>
<h1>保存商品的页面</h1>
<s:form action="product_save" method="POST" namespace="/" theme="simple">
  <table border="1" width="400">
    <tr>
      <td>商品名称</td>
      <td><s:textfield name="pname"/></td>
    </tr>
    <tr>
      <td>商品价格</td>
      <td><s:textfield name="price"/></td>
    </tr>
    <tr>
      <td colspan="2"><input type="submit" value="添加"/> </td>
    </tr>

  </table>
</s:form>
</body>
</html>

映射文件

<?xml version="1.0" encoding="UTF-8"?>
<!--<!DOCTYPE hibernate-mapping PUBLIC-->
        <!--"-//Hibernate/Hibernate Mapping DTD 3.0//EN"-->
        <!--"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">-->

<hibernate-mapping>
    <class name="ssh.domain.Product" table="product">
        <id name="pid" column="pid">
            <generator class="native"/>
        </id>
        <property name="pname" column="pname" length="20"/>
        <property name="price" column="price"/>
    </class>
</hibernate-mapping>

action方法

package ssh.action;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import ssh.domain.Product;
import ssh.service.ProductService;

public class ProductAction extends ActionSupport implements ModelDriven<Product> {

    private Product product=new Product();
    @Override
    public Product getModel() {
        return product;
    }

    private ProductService productService;
    public void setProductService(ProductService productService) {

        this.productService = productService;
    }

    public void save(){
        System.out.println("Action中的save方法执行了...");
        productService.save(product);
    }

}

struts.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
        "http://struts.apache.org/dtds/struts-2.5.dtd">

<struts>

    <package name="ssh" extends="struts-default" namespace="/">
        <action name="product_*" class="productAction" method="{1}">
        </action>
    </package>

</struts>

applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">


    <!--引入外部属性文件-->
    <context:property-placeholder location="classpath:/jdbc.properties"/>


    <!--配置出出c3p0连接池-->
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
        <property name="driverClass" value="${jdbc.driverClass}"/>
        <property name="jdbcUrl" value="${jdbc.url}"/>
        <property name="user" value="${jdbc.username}"/>
        <property name="password" value="${jdbc.password}"/>
    </bean>

    <!--配置hibernate的相关属性-->
    <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
        <!--注入连接池-->
        <property name="dataSource" ref="dataSource"/>
        <!--配置hibernate属性-->
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
                <prop key="hibernate.show_sql">true</prop>
                <prop key="hibernate.format_sql">true</prop>
                <prop key="hibernate.hbm2ddl.auto">update</prop>
            </props>
        </property>
        <!--加载映射文件-->
        <property name="mappingResources">
            <list>
                <value>ssh/domain/Product.hbm.xml</value>
            </list>
        </property>
    </bean>

    <bean id="productDao" class="ssh.dao.ProductDao">
        <property name="sessionFactory" ref="sessionFactory"/>
    </bean>

    <bean id="productService" class="ssh.service.ProductService">
        <property name="productDao" ref="productDao"/>
    </bean>

    <bean id="productAction" class="ssh.action.ProductAction" scope="prototype">
        <property name="productService" ref="productService"/>
    </bean>


</beans>


web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">

    <!--spring核心监听器-->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext.xml</param-value>
    </context-param>

    <!--struts2核心过滤器配置-->
    <filter>
        <filter-name>struts</filter-name>
        <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>

action获取不到jsp传入的pname,price值,而且我在网页的开发者模式下看的时候name值为null,如下图,看不出写的有什么问题,求大神解答
图片说明

并且运行到dao中的this.getHibernateTemplate().save(product);方法时报下面错误

HTTP Status 500 - No value for key [org.hibernate.internal.SessionFactoryImpl@4483c105] bound to thread [http-apr-8080-exec-5]
type Exception report

message No value for key [org.hibernate.internal.SessionFactoryImpl@4483c105] bound to thread [http-apr-8080-exec-5]

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.lang.IllegalStateException: No value for key [org.hibernate.internal.SessionFactoryImpl@4483c105] bound to thread [http-apr-8080-exec-5]
    org.springframework.transaction.support.TransactionSynchronizationManager.unbindResource(TransactionSynchronizationManager.java:210)
    org.springframework.orm.hibernate5.HibernateTransactionManager.doCleanupAfterCompletion(HibernateTransactionManager.java:649)
    org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:1021)
    org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:887)
    org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:834)
    org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:536)
    org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:286)
    org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
    ssh.service.ProductService$$EnhancerBySpringCGLIB$$5317e513.save(<generated>)
    ssh.action.ProductAction.save(ProductAction.java:31)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:498)
    ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:899)
    ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1544)
    ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)
    com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:98)
    com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:90)
    ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1620)
    ognl.ASTMethod.getValueBody(ASTMethod.java:91)
    ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
    ognl.SimpleNode.getValue(SimpleNode.java:258)
    ognl.Ognl.getValue(Ognl.java:470)
    ognl.Ognl.getValue(Ognl.java:434)
    com.opensymphony.xwork2.ognl.OgnlUtil$3.execute(OgnlUtil.java:374)
    com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecuteMethod(OgnlUtil.java:426)
    com.opensymphony.xwork2.ognl.OgnlUtil.callMethod(OgnlUtil.java:372)
    com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:438)
    com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:293)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)
    org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:250)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:179)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
    org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:49)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:142)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:137)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:137)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:201)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:67)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:133)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:85)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:101)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:142)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:160)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:175)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    org.apache.struts2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:121)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:167)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:203)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:196)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
    org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:48)
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:574)
    org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)
    org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141)
0

1个回答

你在jsp页面那个nam属性改成 对象名.属性 试试 对象名就是在action里面定义的实体对象名

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
SSH 如何把后台值传到JSP页面
在JSP页面怎么走后台俩个方法,然后返回到页面。rnrn怎么调用后台的方法,然后返回页面
ssh问题求大神解答
[color=#800000]在学习ssh架构的时候遇到下面问题:rn这是web.xml文件[/color]rnrnrn rn struts2rn rn org.apache.struts2.dispatcher.FilterDispatcherrn rn rn rn struts2rn *.actionrn rn rn struts2 rn *.jsp rn rn rn struts-cleanup rn org.apache.struts2.views.jsp.ui.AnchorTagrn rn rn rn struts-cleanuprn /*rn rn rn index.jsprn rn rn rn rn org.springframework.web.context.ContextLoaderListenerrn rn rnrnrnrn[b]rn这是index.jsp文件[/b][color=#800000][/color]rn<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>rn<%rnString path = request.getContextPath();rnString basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";rn%>rn<%@ taglib prefix="s" uri="/struts-tags" %>rnrnrn rn rn rn My JSP 'index.jsp' starting pagern rn rn rn rn rn rn rn rn rn Operate Listrn [color=#FF0000]Save User rn List Users[/color]rn rnrn[color=#FF0000]标签前面有小感叹号rn运行的时候出现404错误[/color]rnrnrnrn但是刚刚搭建好的ssh架构,运行index.jsp是没有任何问题的,准备加点代码,结果就成了这样,求大神解答!!!万分感激
SSH jsp页面得不到Action的值!急
RT.为什么呀?rnrn调试的时候我看employeelist中是有值的.rnSystem.out.println(employeelist.size()); 这句输出1了 说明有值rn但是在jsp页面我用的rnrn rn/s:iterator> rnrn输出为0 说明没有得到.rnrn高手帮一下!谢谢了!rnrnrn=================Action方法rn public List employeelist;rnrn public List getEmployeelist() rn return employeelist;rn rnrn public void setEmployeelist(List employeelist) rn this.employeelist = employeelist;rn rnrn public String list_Emp() rn tryrn //employeelist=new ArrayList();rn employeelist=(List)employeeManager.getEmps(); //返回employee表的数据.rn System.out.println(employeelist.size());rn catch (Exception e) rn System.out.println(e.toString());rn finally rn return SUCCESS;rn rn rn
action在JSP页面中无法传参
这主要是传入MajorNo来执行删除rn报错:[code=text]org.springframework.dao.InvalidDataAccessResourceUsageException: could not load an entity: [com.jygzxt.po.major.Major#0101]; SQL [select major0_.Major_no as Major1_0_0_, major0_.Major_name as Major2_0_0_, major0_.DeptAdmin_no as DeptAdmin3_0_0_, major0_.DepartAdmin_Name as DepartAd4_0_0_ from jygzxtw.major major0_ where major0_.Major_no=?]; nested exception is org.hibernate.exception.SQLGrammarException: could not load an entity: [com.jygzxt.po.major.Major#0101]rn[/code]rn在JSp页面中:rn
jsp页面文本框中的值不能传到action,寻求原因?
我用的struts2+spring+hibernate框架rn我现在的问题是我在jsp页面加了个文本框,并设置了初始值,运行在action中得到的值为nullrnjsp页面是这样的:rn<%@page contentType="text/html; charset=utf-8"%>rn<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>rnrnrnrnrn rn 发送短信rnrnrnrnrnrn rnrn rn 输入查询条件:rn 111 rn 111 rn rnrnrn rn rnrn rnrnrnrnrnrnrnrnaction如下:rnrnpublic class DeviceSetSmsAction extends BaseAction rnrn /**rn * rn */rn private static final Log logger = LogFactory.getLog(DeviceSetSmsAction.class);rn private static final long serialVersionUID = -646017346458937675L;rn rn private String query1;rn private String userName;rnrn public String getUserName() rn return userName;rn rnrn public void setUserName(String userName) rn this.userName = userName;rn rnrn public String getQuery1() rn return query1;rn rnrn public void setQuery1(String query1) rn this.query1 = query1;rn rnrn public String index() rn return "index";rn rnrn public String execute() rn rn System.out.println(this.getUserName()+"****************************");rn System.out.println(this.getQuery1()+"==============+++++++++====");rn try rn return this.executeMethod(this.getAction());rn catch (Exception e) rn logger.error(e);rn return ERROR;rn rn rnrn rnrn这样测试得到的值为null,请教高手了!
jsp页面提交action问题 求大神解
rn rn rn rn rn rn 标题:rn rn rn rn 内容:rn rn rn rn 类型:rn rn rn rn rn rn rn rnrnrnrn上面是我的页面代码 只要文本框里面没有值它就能成功得跳action 但是一有值就不行了 求解是为什么啊
安装ruby过程中遇到一些问题,求大神解答啊
[size=24px]安装ruby过程中出现uninitialized constant AppGenerator ::Config代码,翻译过来的意思是“未初始化常数appgenerator::配置”rn不知如何解决,跪求大神解答[/size]
ssh整合遇到action无法实例化问题
Unable to instantiate Action, com.test.action.TestUserAction, defined for 'testUserAction' in namespace '/'com.test.action.TestUserActionrn com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:319)rn com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:400)rn com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)rn org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)rn org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)rn com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:500)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:119)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rnroot causernrnjava.lang.ClassNotFoundException: com.test.action.TestUserActionrn org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1701)rn org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)rn com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:157)rn com.opensymphony.xwork2.ObjectFactory.getClassInstance(ObjectFactory.java:107)rn com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:233)rn com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:153)rn com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150)rn com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:120)rn com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:300)rn com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:400)rn com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)rn org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)rn org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)rn com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:500)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:119)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rnrnrnweb.xml配置:rnrnrn DKTestrn rn index.jsprn rn rn rn openSessionInViewFilterrn org.springframework.orm.hibernate4.support.OpenSessionInViewFilterrn rn singleSessionrn truern rn rn sessionFactoryBeanNamern sessionFactoryrn rn rn rn rn rn openSessionInViewFilterrn *.actionrn rn rn struts2rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilterrn rn rn struts2rn *.actionrn rn rn rn rn contextConfigLocationrn rn classpath:applicationContext.xmlrn rn rn rn org.springframework.web.context.ContextLoaderListenerrn rnrnrnrnapplicationContext.xml:配置如下rnrnrn?xml version="1.0" encoding="UTF-8"?>rnrnrn Spring公共配置文件rn rn rnrn rn rn rn rn rn classpath:jdbc.propertiesrn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn com.**.model rn rn rn rn rn rn rn rn rn $hibernate.dialectrn rn rn rn $hibernate.show_sqlrn rn rn rn $hibernate.hbm2ddl.autorn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrnrn查了好多资料 都无发解决,纠结两天了,请各位大神帮帮忙。rn
为什么jsp页面单选框的值传到action的值一直是第一个单选按钮的value值{请教大神帮忙看一下}
jsp页面代码性&amp;amp;nbsp&amp;amp;nbsp&amp;amp;nbsp&amp;amp;nbsp别:女&amp;lt;input type=&quot;radio&quot; name=&quot;userGender&quot; value=&quot;女&quot;/&amp;gt;                 男&amp;lt;input type=&quot;radio&quot; name=&quot;userGender&quot; value=&quot;
jsp页面中的下拉菜单的value值在Struts2的Action中无法取到
各位老师,今天上午小弟在用Strus2做项目时遇到了这样的问题,在jsp页面中使用了下拉菜单,但是在Struts2的Action中却无法取到其value值。这个问题困扰我一上午了,我都快绝望了,希望各位老师能够帮帮小弟。谢谢啦!rnrn下面是jsp页面中下拉菜单的代码和Struts2的Action中的代码:rn rn rn 全部 rn 离职rn 在职rn 实习生rnrnrnrnrnprivate String status;rnrnpublic String getStatus() rn return status;rnrnrnpublic void setStatus(String status) rn this.status = status; rnrn我在网上看到很多老师说在Struts2的Action中定义的变量名必须要和jsp页面中select标签的name属性的值一样,我也这么做了,为什么还是去不到下拉菜单的value值呢?
jsp页面中的值传到actin中
已注册——按类别显示学生信息 rnrn问题是这样的:上面的语句是在jsp中 我想把isRegisterisRegister=1的值传到对应的action中但是我在日志输出isRegister的值时发现所出错的值是0(System.out.println("isRegister 的值为: "+student.getIsRegister());也就是说[color=#FF0000]无法将jsp页面中设定的值传递到action中。[/color]rn大家看下如何解决?
SSH框架搭建的时候遇到的问题
SSH框架搭建的时候遇到的问题 1、spring-web.jar包问题:使用user libaries方式,识别不到,于是出现了下面问题 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListenerat org.apache.catalina....
SSH整合过程中,Action中无法获得service类的实例
我在spring里面配置了Action和service类的bean:rn rn rn rn rnrn rn rn rn rnrn可是我在Action中用SysManageImpl 类的实例sysManage调用方法时,抛出空指针异常,我做了各种测试,[color=#FF0000]都表明是sysManage没有实例化[/color],我问过老师,老师说可能是Struts2和Spring整合过程有哪里出了问题,我想问Struts2和Spring整合过程需要注意哪些问题[color=#FF0000],还有就是sysManage没有实例化是什么原因?[/color]rn[code=java]rn//Action类rnpublic class SysManagerAction extends ActionSupport rn private static final long serialVersionUID = 1L;rnprivate HttpServletRequest request;rnprivate Student student; rn private SysManageImpl sysManager;rn//省略各setter和getter方法rnrnpublic String add()rntry rn [color=#FF0000]sysManager.sysUpdateStudent(student, operateType);[/color]rn return "addSuccess";rn catch (Exception e) rn e.printStackTrace();rn return "addFail";rn rn rnrn[/code]rnrn
这是神马情况?求SSh大神···(空指针)
rn rn rn rn 个人信息rn rn 用户名:rn rn rn rn rn rn 真实姓名:rn rn rn rn rnrn rn 电子邮箱: rn ">rn rn rn rn 联系电话:rn rn ">rn rn rn rn 修改信息rn 返回 rn rn rnrn 点保存的时候:地址栏如下rnhttp://localhost:8080/scnupm/student/updataStudent?person.password=&person.id=&person.type=&person.account=fuhuasishui&person.name=%E5%BC%A0%E6%98%8E%E5%8D%8E&person.email=15521267125%40163.com&person.telephone=13560134432rn×××××××××××××××××××××××××××××××××××××××××××××××××××××××rn Structs配置如下:rn rn /student/personalmanage.jsprn rn rn rn /student/personalmanage.jsprn rn×××××××××××××××××××××××××××××××××××××××××××××××××××××××Action的函数如下: rnpublic String execute() throws Exception rn tryrn System.out.println(person.getId()+":test0");rn studentService.updataStudent(person);rn catch(Exception e)rn e.printStackTrace();rn rn return SUCCESS;rn rn控制台输出的为:rnnull:test0rnrnjava.lang.NullPointerExceptionrn at cn.edu.scnu.cs.scnupm.service.impl.StudentServiceImpl.updataStudent(StudentServiceImpl.java:61)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)rn at $Proxy9.updataStudent(Unknown Source)rn at cn.edu.scnu.cs.scnupm.action.person.UpdataStudentAction.execute(UpdataStudentAction.java:19)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)rn ·····rnserver层的代码为rn public boolean updataStudent(Person user) rn if (persondao.findById(user.getId()) != null) rn // 如果存在则调用dao组件删除srn persondao.update(user);rn System.out.println(user.getId()+":test"); (!控制台没有输出这个)rn else rn System.out.println("false:test");rn return false;rn rn return true;rn
求问ssh框架中jsp页面传给action指定方法,action无法自动获取
求问ssh框架中jsp页面传给action指定方法,action无法自动获取,jsp中name也指定了,action无法get到textfiled传进去的值
SSH框架jsp页面与Action的值传递
jsp页面 &lt;ahref="xx.action?userName=xx"xx.action里面 privateStringuserName publicvoidsetUserName(StringuserName){ this.userName=userName; } publicStringgetUsername(){ returnusername ...
s2sh框架搭建的action不用return返回jsp页面
用s2sh做的网站我用action直接return返回到jsp页面,老板说用mvc设计模式搭建,用return返回数据过多的话会访问慢,n有没有其他方法action传到jsp,最好有个小项目增删改查,我用的oracle数据库
在jsp页面中显示action中的setter的值
Action:// 属性private List&amp;lt;Bean&amp;gt; lst;lst属性对应有get/set方法。Bean:// 属性private String id;private String name;id和name属性有get/set方法。Jsp:&amp;lt;table&amp;gt;  &amp;lt;s:iterator value=&quot;lst&quot;&amp;gt;  &amp;lt;tr&amp;gt;  &amp;lt;td&amp;gt;...
SSH JSP页面显示不出Action值来,Hibernate获取值正常,可以插入数据,求大神速回!
rnrnimport java.sql.Date;rnimport java.util.List;rnrnrn/**rn * 商品业务rn */rnpublic class BlurbServiceImplrn BlurbDAO blurbDAO = (BlurbDAO)AppContext.getBean("blurbDAO");rn rn /*rn * 修改rn */rn public void updateBlurb(String barCode)rn this.blurbDAO.updateBlurb(barCode);rn rn /*rn * 添加rn */rn public void addBlurb(Blurb blurb) rn this.blurbDAO.addBlurb(blurb);rn rn /*rn * 根据时间查询rn */rn public List findDate(Date productuionDate)rn return this.blurbDAO.findDate(productuionDate);rn rn /**rn * 分页查询rn */rn public PageModel findByPage(final int pageNo, final int pageSize) rn return this.blurbDAO.findByPage(pageNo, pageSize);rn rn rn rn public BlurbDAO getBlurbDAO() rn return blurbDAO;rn rn rn public void setBlurbDAO(BlurbDAO blurbDAO) rn this.blurbDAO = blurbDAO;rn rnrnrn```rn
无法在JSP页面显示内容,求大神指点!!!
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>rn<%@page import="java.util.*,com.myEdition.bean.*" %>rnrnrn rn 内网首页rn rn rn <% List contentTypes = (List)request.getAttribute("contentTypes");rn Map contents = (Map) request.getAttribute("contents");rn %>rn rn rn rn 内网首页rn rn rn <%rn for(int i = 0;contentTypes !=null &&i rn rn <%=((ContentType)contentTypes.get(i)).getName()%>rn rn rn <%=((ContentType)contentTypes.get(i+1)).getName()%>rn rn rn rn rn rn <% rn List contentsList = (List)contents.get((((ContentType)contentTypes.get(i)).getId())); rn for (int j = 0;contentsList !=null&&j< contentsList.size();j++)rn %>rn <%=((Content) contentsList.get(j)).getTitle()%><% %>rn rn rn rn rn <% contentsList = (List)contents.get((((ContentType)contentTypes.get(i+1)).getId()));rn for(int j=0;contentsList !=null&&jrn <%=((Content) contentsList.get(j)).getTitle()%>rn <% %>rn <%rn rn %>rn rn rn rn rn rn rn 更多内容rn rn rn rn rn rn 更多内容rn rn rn rn rn rn rnrnrn----------------------------------------------------------------------------------------rn这几行为何无法在页面输出内容??rnrn rn <% rn List contentsList = (List)contents.get((((ContentType)contentTypes.get(i)).getId())); rn for (int j = 0;contentsList !=null&&j< contentsList.size();j++)rn %>rn <%=((Content) contentsList.get(j)).getTitle()%><% %>rn rn rn rn rn <% contentsList = (List)contents.get((((ContentType)contentTypes.get(i+1)).getId()));rn for(int j=0;contentsList !=null&&jrn <%=((Content) contentsList.get(j)).getTitle()%>rn <% %>rn <%rn rn %>rn rn rn rn我验证了,都不为空,但是为何不输出呢?
action的值传到session里面
[img]http://dl.iteye.com/upload/attachment/437588/dced201c-97a7-353f-957f-e47b5058bdeb.png[/img] 上面这种方式,我经过尝试,证明可以。下面这种方式我没有尝试,供大家参考: [img]http://dl.iteye.com/upload/attachment/437590/4b925f83-4abc-...
如何把值传到action
rnaa2 rn8 rnrnrn rnrnaaa3 rn14 rnrn rnrn上面是2个radio,(aa2,8,textbox值),(aaa3,14,textbox)值是我要传到action当中的值rn如何才能当我选第一个radio,传第一组值,选第二个传第二组值rnrnradio和数值及textbox是用循环做出来的,数值是bean:write出来的rn谢谢了
小白遇到一道难题,求大神解答?
题目:完成groupAndSort方法,对列表按照groupName分组,并对每个组内的数据按照value倒叙排序rn```rnpublic class Arn public String groupName;rn public int value;rn rnrnMap> groupAndSort(List list)rnrn rn rn```
Myeclipse6.0中SSH框架搭建
<!-- 事务处理 --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> <!-- 其它Bean定义在此 --> <!-- 定义拦截器 --> <bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor"> <property name="transactionManager" ref="transactionManager"></property> <property name="transactionAttributes"> <props> <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean>
SSM框架+Dubbo+shiro的框架搭建,遇到的@Reference标签无法注入的情况
最近自己在搭建一个SSM+Dubbo+shiro的分布式框架,但是在搭建过程中,遇到了Dubbo服务无法使用@Reference标签注入的情况;   错误展示 org.apache.shiro.authc.AuthenticationException: Authentication failed for token submission [org.apache.shiro.authc.U...
遇到的问题,真心跪了,求大神解答
我想在txt文件中读取一个字符,然后再字库中找到这个字符,同时将这个字符的ASCII码存放到一个二维数组中,最后在终端显示这个二维数组,为1显示“*”,0显示为空,代码可以获取字符,也可以转化成ASCII,但是传递后就出现问题了,代码如下,真心求解释,先谢谢各位大神了。。。rn[code=c]rn#include rn#include rn#include rnrnchar FILE_ReadChar();rnchar * FILE_LetterDisplag(char cVal, char *pcArray);rnrnint main(int nArgc, char *pcArgv[])rnrn char acStr[16][8] = '\0';rn char *pcStr = NULL;rn char cVal = '\0';rn int nX = 0;rn int nY = 0;rnrn cVal = FILE_ReadChar();rnrn printf("%c\n", cVal);rnrn pcStr = FILE_LetterDisplag(cVal, &acStr[0][0]);rnrn for(nX = 0; nX < 16; nX++) //用于显示字母rn rn for(nY = 0; nY < 8; nY++)rn rn if('1' == *(pcStr + nX * nY + nY))rn rn printf("* ");rn rn elsern rn printf(" ");rn rn rn printf("\n");rn rn while(1);rn return 0;rnrnrnchar FILE_ReadChar()rnrn static int nOffset = 0;rn FILE *pfData = NULL;rn char cVal = '\0';rnrn pfData = fopen("./Src.txt", "r");rnrn if(NULL == pfData) //打开文件失败rn rn return -1;rn rnrn fseek(pfData, nOffset * 1, SEEK_SET);rn fread(&cVal, 1, 1, pfData);rn fclose(pfData);rnrn nOffset++;rnrn return cVal;rnrnrnchar * FILE_LetterDisplag(char cVal, char *pcArray)rnrn int nX = 0;rn int nY = 0;rn int nIndex = 0;rn FILE *pfData = NULL;rn char cStore[16] = 0;rn char cBuff = '\0';rnrn pfData = fopen("./ASC16.bin", "r");rnrn if(NULL != pfData)rn rn fseek(pfData, cVal * 16, SEEK_SET);rn fread(cStore, 16, 1, pfData);rn fclose(pfData);rn rn rn for(nX = 0; nX < 16; nX++)rn rn for(nIndex = 7, nY = 0; nIndex >= 0; nIndex--, nY++)rn rn cBuff = (cStore[nX] >> nIndex) & 1;rn if(0 == cBuff)rn rn *(pcArray + nX * nY + nY) = '0';rn rn elsern rn *(pcArray + nX * nY + nY) = '1';rn rn printf("%c", *(pcArray + nX * nY + nY)); //调试语句rn rn printf("\n");rn rn printf("\n");rn //这里用于调试rn for(nX = 0; nX < 16; nX++) //和前面的printf("%c", *(pcArray + nX * nY + nY));值不一致rn rn for(nY = 0; nY < 8; nY++)rn rn printf("%c", *(pcArray + nX * nY + nY));rn rn printf("\n");rn rn printf("\n");rn return pcArray;rnrnrn[/code]
LPC1788遇到神奇的问题,求大神解答
我把程序从FLASH起始地址0X0烧进去是没有问题,但是从FLASH的地址0X4000烧进去会出现以下错误rnContents mismatch at: 00018000H (Flash=00H Required=9EH) !rnContents mismatch at: 00018002H (Flash=00H Required=FFH) !rnContents mismatch at: 00018003H (Flash=00H Required=FFH) !rnContents mismatch at: 00018004H (Flash=00H Required=9FH) !rnContents mismatch at: 00018006H (Flash=00H Required=FFH) !rnContents mismatch at: 00018007H (Flash=00H Required=FFH) !rnContents mismatch at: 00018008H (Flash=00H Required=A0H) !rnContents mismatch at: 0001800AH (Flash=00H Required=FFH) !rnContents mismatch at: 0001800BH (Flash=00H Required=FFH) !rnContents mismatch at: 0001800CH (Flash=00H Required=A1H) !rnContents mismatch at: 0001800EH (Flash=00H Required=FFH) !rnContents mismatch at: 0001800FH (Flash=00H Required=FFH) !rnContents mismatch at: 00018010H (Flash=00H Required=A2H) !rnContents mismatch at: 00018012H (Flash=41H Required=FFH) !rnContents mismatch at: 00018013H (Flash=00H Required=FFH) !rnContents mismatch at: 00018014H (Flash=00H Required=FFH) !rnContents mismatch at: 00018015H (Flash=00H Required=FFH) !rnContents mismatch at: 00018016H (Flash=01H Required=FFH) !rnContents mismatch at: 00018017H (Flash=00H Required=FFH) !rnContents mismatch at: 00018018H (Flash=04H Required=FFH) !rnContents mismatch at: 00018019H (Flash=00H Required=FFH) !rnContents mismatch at: 0001801AH (Flash=00H Required=FFH) !rnContents mismatch at: 0001801BH (Flash=00H Required=FFH) !rnContents mismatch at: 0001801CH (Flash=00H Required=FFH) !rnContents mismatch at: 0001801DH (Flash=00H Required=FFH) !rnContents mismatch at: 0001801EH (Flash=01H Required=FFH) !rnContents mismatch at: 0001801FH (Flash=00H Required=FFH) !rnContents mismatch at: 00018020H (Flash=00H Required=FFH) !rnContents mismatch at: 00018021H (Flash=00H Required=FFH) !rnContents mismatch at: 00018022H (Flash=00H Required=FFH) !rnContents mismatch at: 00018023H (Flash=00H Required=FFH) !rnContents mismatch at: 00018024H (Flash=00H Required=FFH) !rnContents mismatch at: 00018025H (Flash=00H Required=FFH) !rnContents mismatch at: 00018026H (Flash=00H Required=FFH) !rnContents mismatch at: 00018027H (Flash=00H Required=FFH) !rnContents mismatch at: 00018028H (Flash=00H Required=FFH) !rnContents mismatch at: 00018029H (Flash=00H Required=FFH) !rnContents mismatch at: 0001802AH (Flash=00H Required=FFH) !rnContents mismatch at: 0001802BH (Flash=00H Required=FFH) !rnContents mismatch at: 0001802CH (Flash=00H Required=FFH) !rnContents mismatch at: 0001802DH (Flash=00H Required=FFH) !rnContents mismatch at: 0001802EH (Flash=00H Required=FFH) !rnContents mismatch at: 0001802FH (Flash=00H Required=FFH) !rnContents mismatch at: 00018030H (Flash=00H Required=FFH) !rnContents mismatch at: 00018031H (Flash=00H Required=FFH) !rnContents mismatch at: 00018032H (Flash=00H Required=FFH) !rnContents mismatch at: 00018033H (Flash=00H Required=FFH) !rnContents mismatch at: 00018034H (Flash=00H Required=FFH) !rnContents mismatch at: 00018035H (Flash=00H Required=FFH) !rnContents mismatch at: 00018036H (Flash=00H Required=FFH) !rnContents mismatch at: 00018037H (Flash=00H Required=FFH) !rnContents mismatch at: 00018038H (Flash=00H Required=FFH) !rnContents mismatch at: 00018039H (Flash=00H Required=FFH) !rnContents mismatch at: 0001803AH (Flash=01H Required=FFH) !rnContents mismatch at: 0001803BH (Flash=00H Required=FFH) !rnContents mismatch at: 0001803CH (Flash=00H Required=7EH) !rnContents mismatch at: 0001803EH (Flash=09H Required=FFH) !rnContents mismatch at: 0001803FH (Flash=00H Required=FFH) !rnContents mismatch at: 00018040H (Flash=04H Required=76H) !rnContents mismatch at: 00018042H (Flash=00H Required=FFH) !rnContents mismatch at: 00018043H (Flash=00H Required=FFH) !rnContents mismatch at: 00018044H (Flash=00H Required=7FH) !rnContents mismatch at: 00018046H (Flash=01H Required=FFH) !rnContents mismatch at: 00018047H (Flash=00H Required=FFH) !rnContents mismatch at: 00018048H (Flash=00H Required=80H) !rnContents mismatch at: 0001804AH (Flash=01H Required=FFH) !rnContents mismatch at: 0001804BH (Flash=00H Required=FFH) !rnContents mismatch at: 0001804CH (Flash=00H Required=81H) !rnContents mismatch at: 0001804EH (Flash=00H Required=FFH) !rnContents mismatch at: 0001804FH (Flash=00H Required=FFH) !rnContents mismatch at: 00018050H (Flash=00H Required=82H) !rnContents mismatch at: 00018052H (Flash=00H Required=FFH) !rnContents mismatch at: 00018053H (Flash=00H Required=FFH) !rnContents mismatch at: 00018054H (Flash=00H Required=83H) !rnContents mismatch at: 00018056H (Flash=01H Required=FFH) !rnContents mismatch at: 00018057H (Flash=00H Required=FFH) !rnContents mismatch at: 00018058H (Flash=00H Required=84H) !rnContents mismatch at: 0001805AH (Flash=09H Required=FFH) !rnContents mismatch at: 0001805BH (Flash=00H Required=FFH) !rnContents mismatch at: 0001805CH (Flash=00H Required=85H) !rnContents mismatch at: 0001805EH (Flash=00H Required=FFH) !rnContents mismatch at: 0001805FH (Flash=00H Required=FFH) !rnContents mismatch at: 00018060H (Flash=00H Required=86H) !rnContents mismatch at: 00018061H (Flash=10H Required=00H) !rnContents mismatch at: 00018062H (Flash=01H Required=FFH) !rnContents mismatch at: 00018063H (Flash=00H Required=FFH) !rnContents mismatch at: 00018064H (Flash=00H Required=87H) !rnContents mismatch at: 00018066H (Flash=00H Required=FFH) !rnContents mismatch at: 00018067H (Flash=00H Required=FFH) !rnContents mismatch at: 00018068H (Flash=00H Required=88H) !rnContents mismatch at: 0001806AH (Flash=00H Required=FFH) !rnContents mismatch at: 0001806BH (Flash=00H Required=FFH) !rnContents mismatch at: 0001806CH (Flash=00H Required=89H) !rnContents mismatch at: 0001806EH (Flash=01H Required=FFH) !rnContents mismatch at: 0001806FH (Flash=00H Required=FFH) !rnContents mismatch at: 00018070H (Flash=00H Required=8AH) !rnContents mismatch at: 00018072H (Flash=00H Required=FFH) !rnContents mismatch at: 00018073H (Flash=00H Required=FFH) !rnContents mismatch at: 00018074H (Flash=00H Required=8BH) !rnContents mismatch at: 00018076H (Flash=01H Required=FFH) !rnToo many errors to display !rn哪位大神能帮我解答下吗,非常感谢
SSH中Struts2获取不到jsp页面中值,求大神指点
ssh框架整合,添加员工信息;n员工,Emp:nnn```n package com.blue.entity;nnpublic class Emp n //id,数据库中为标识列n private int empId;n //姓名n private String empName;n //年龄n private int empAge;n //性别n private String empSex;n n n public int getEmpId() n return empId;n n public void setEmpId(int empId) n this.empId = empId;n n public String getEmpName() n return empName;n n public void setEmpName(String empName) n this.empName = empName;n n public int getEmpAge() n return empAge;n n public void setEmpAge(int empAge) n this.empAge = empAge;n n public String getEmpSex() n return empSex;n n public void setEmpSex(String empSex) n this.empSex = empSex;n n n nnn```nnnnjsp页面,form:nnn```n n n n 姓名:n n n n 年龄:n n n n 性别:n n n n n n n n```naction:nnn```n package com.blue.action;nnimport org.springframework.context.ApplicationContext;nimport org.springframework.context.support.ClassPathXmlApplicationContext;nnimport com.blue.entity.Emp;nimport com.blue.service.EmpService;nimport com.opensymphony.xwork2.ActionSupport;nnpublic class EmpAction extends ActionSupportn public String result()n ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");n n EmpService empService= (EmpService) context.getBean("empService");n Emp emp = (Emp) context.getBean("emp");n n //测试n System.out.println("id:"+emp.getEmpId()+" name:"+emp.getEmpName()+" age:"+emp.getEmpAge()+" sex:"+emp.getEmpSex());n n int num = empService.save(emp);n n if(num == -1)n //值为空n return "empty";n else if(num > 0)n //添加成功n return SUCCESS;n elsen //失败n return ERROR;n n nnn控制台输出:nid:0 name:null age:0 sex:nulln```nnspring配置文件(beans.xml):nnn```n nn n n n n classpath:hibernate.cfg.xmln n n n n n n n n n n n n n n n n n n nn```nnstruts.xml:nnn```n nnn n n n n n welcome.jspn error.jspn n n empty.jspn n nn```n包结构:n![图片说明](https://img-ask.csdn.net/upload/201610/02/1475398814_503001.png)nn取不到页面值,求大神指点n
jsp页面无法获取action参数
我用的是struts2 action中有参数message(action中有对应的get方法) 成功登陆后页面中我用$message来显示登陆成功的信息 可是发现都接收不到 希望高手能够帮忙解决下!rn这是我的actionrnpackage action;rnrnimport javax.servlet.http.HttpSession;rnrnimport org.apache.struts2.ServletActionContext;rnrnimport manager.UserManager;rnimport model.User;rnrnimport com.opensymphony.xwork2.ActionSupport;rnrnpublic class UserAction extends ActionSupportrnrn private String username;rn private String password;rn private UserManager userManager;rn private String message;rn private User user;rnrn public void setUserManager(UserManager userManager) rn this.userManager = userManager;rn rn public void setUsername(String username) rn this.username = username;rn rn public void setPassword(String password) rn this.password = password;rn rn public String getMessage() rn return message;rn rn public User getUser() rn return user;rn rn public String login()rn rn User user = userManager.login(username, password);rn if (user==null) rn message="用户名或密码错误";rn return INPUT;rn rn HttpSession session = ServletActionContext.getRequest().getSession();rn session.setAttribute("user", user);rn this.user= user;rn return SUCCESS;rn rnrn这是我的struts.xml文件rnrnrnrn rn rn rn rn /user/success.jsprn /login.jsprn rn rn rn
jsp页面中无法显示数据库的表内容,求大神解答。
java文件npackage xscj_bean;nimport java.sql.*;npublic class SQLServerConnBean n private Statement stmt = null;n private Connection conn = null;n ResultSet rs = null;n //构造函数n public SQLServerConnBean () n public void OpenConn( ) throws Exceptionn n tryn n Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance(); n String url = "jdbc:sqlserver://localhost:1433;databaseName=classcircle"; n String user = "sa"; n String password = "123456789123456"; n conn = DriverManager.getConnection( url, user, password ); n n catch(SQLException e)n n System.err.println("Data.executeQuery: " + e.getMessage());n n n //执行查询类的SQL语句,有返回集n public ResultSet executeQuery(String sql) n n rs = null;n try n n stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVEn ,ResultSet.CONCUR_UPDATABLE);n rs = stmt.executeQuery(sql);n n catch(SQLException e) n n System.err.println("Data.executeQuery: " + e.getMessage());n n return rs;n n //关闭对象n public void closeStmt()n n try n n stmt.close();n n catch(SQLException e) n n System.err.println("Date.executeQuery: " + e.getMessage());n n n public void closeConn()n n tryn n conn.close();n n catch(SQLException e) n n System.err.println("Data.executeQuery: " + e.getMessage());n n nnn```n jsp文件n <%@ page contentType="text/html; charset=utf-8"%>n<%@ page language="java" import="java.sql.*"%>nnnn n JDBC连接SQL Server数据库n n nn n JDBC连接SQL Server数据库 n n n n 学号n 姓名n 专业n 总学分n n <%n //查询XSB表中XH,XM,ZY和ZXF字段的前10条记录n String sql="select top 10* From student";n SqlBean.OpenConn( ); //调用SqlBean中加载JDBC驱动的成员函数n ResultSet rs=SqlBean.executeQuery(sql); //取得结果集n n while( rs.next( ) )n n %>n n <%=rs.getString("username")%>n <%=rs.getInt("password")%>n <%=rs.getInt("schoolnumber")%>n <%=rs.getInt("ZXF")%>n n <%n n %>n <%n out.print("数据库操作成功,恭喜你!");n rs.close();n SqlBean.closeStmt();n SqlBean.closeConn();n %>n nnn```n结果却是这样的n![图片说明](https://img-ask.csdn.net/upload/201704/24/1493024444_355993.png)n小白求助啊!!!!
struts2 action无法获得jsp页面中的参数
UserRoot.javarn[code=Java]rnpublic class UserRoot extends ActionSupportrn protected String username;rn protected String password;rn protected String re_password;rn protected String address;rn protected UserService userService;rn //省略setter和getter方法rnrn[/code]rnrnLogin.javarn[code=Java]rnpublic class Login extends UserRootrn@Overridern public String execute()throws Exceptionrn HttpSession session = ServletActionContext.getRequest().getSession();rn //如果加上下面两行代码,通过request就可以获得username,否则为空rn //HttpServletRequest req = ServletActionContext.getRequest();rn //String test = req.getParameter("username");rn System.out.println("======="+username);rn if(userService==null)rn System.out.println("UserService is null......");rn rn User user = userService.login(username, password);rn if(user!=null)rn session.setAttribute("username", username);rn return SUCCESS;rn elsern addActionError("用户名或密码错误");rn return ERROR;rn rn rnrn[/code]rnrnstruts2.xmlrn[code=XML]rnrn rn /welcome.jsprn /error.jsprn rnrn[/code]rnrnapplicationContext.xmlrn[code=XML]rnrn rnrnrnrnrnrnrn rn rn rn loginrn rn rn rn rn testAdvicern rn rnrn[/code]rnrnTestAdvice.javarn[code=Java]rnimport java.lang.reflect.Method;rnrnimport org.springframework.aop.MethodBeforeAdvice;rnrnpublic class TestAdvice implements MethodBeforeAdvicern public void before(Method method, Object args[], Object target)rn System.out.println(method.getName()+" will exe");rn rnrn[/code]rnrn为什么在加上Spring Aop后就不能在Action中直接获得username的值了呢?在官方文档中貌似不推荐在Action中使用ServletAPI,各位大神,这是怎么回事啊?
struts1.2 Action无法传值到jsp页面
代码如下rnrnpublic class ListArticleAction extends Actionrn public ActionForward execute(ActionMapping mapping,ActionForm form,rn HttpServletRequest request,HttpServletResponse response)rn Connection conn = null;rn tryrn conn = getDataSource(request,"sqlServer").getConnection();rn articleBean abean = new articleBean();rn abean.setConn(conn);rn List data = abean.ListArticle();rn request.setAttribute("articleList",data);rn return mapping.findForward("success"); rn catch(SQLException e)rn e.printStackTrace();rn return mapping.findForward("failed");rn rn rnrnrnrnrn<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>rn<%@ taglib uri="http://struts.apache.org/tags-bean"prefix="bean" %>rn<%@ taglib uri="http://struts.apache.org/tags-html"prefix="html" %>rn<%@ taglib uri="http://struts.apache.org/tags-logic"prefix="logic" %>rnrnrnrn rn rn rn rn rn rn rn 文章预览rn rn rn rn rn rn rn 编辑rn 删除rn rn rn rn 作者: rn 分类: rn 时间: rn rn rn rn rn 未添文章!rn rn rn rn 增加文章rn rn rn rn rnrnrnrn数据库中已有数据,其它的配置都已完成,但页中查找不到数据库数据。
jsp页面如何得到action中的值
我在action中写好了get和set方法,但是jsp页面取不到值 下面是代码,在线等,急求!!!!rnrnaction中:rnprivate List list ;rn public String execute()rn list = this.regionService.getMonth();rn return SUCCESS;rn rnrn public List getList() rn return list;rn rnrn public void setList(List list) rn this.list = list;rn rnrnjsp中:rn rn rn rnrnaction调试的时候是有值的,但是jsp中没有值,jsp中用debug调试,在堆栈中也没看到有list,这是什么情况,急等!rn
structs2标签 jsp页面把list传到action
structs2标签 我原来从action传一个list到jsp页面,现在想让list在页面多得到一个属性,再把list传回到action中,要怎么写啊?把jsp页面里要的代码写出来就行,要用structs2标签。我举个例子:rn rn rn rn这个是action传过来的list,有两个属性了,我希望可以在jsp页面中使它再多一个属性,让回传回到action中去。rn这个其实简单的来说就是,我action里传了个学生列表(每个学生有id name之类的属性)到页面上,现在我希望的是可以多一个属性,在每个学生前面都有个选择框,当在选择框里打了勾以后,这个属性的值就为1,没打勾的就为0,这样传回到action里去,这样就可以知道哪里学生被选择了,哪些没被选择
求jsp页面异常解答
报错位置:rn rn rn错误信息:rn 严重: Servlet.service() for servlet jsp threw exceptionrnorg.apache.jasper.JasperException: /WEB-INF/jsp/p/info_list.jsp(41,7) The attribute prefix fun does not correspond to any imported tag libraryrn at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)rn at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)rn at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)。。。rn已经有: rnrn问题出在哪,急!!rnrnrnrn
action如何获取JSP页面的值?
用的struts2 框架rnj1.jsp form 的input框里 hidden 一个属性str 并且 include j2.jsprnj1 和 j2 都有各自的formrnj2.jsp 提交按钮到 actionrnrn请问在action里 如何拿到 j1.jsp里的str?rnrequest.getParameter("str") 好像拿不到
Struts2下Action得不到JSP页面值
除了属性名称不匹配、Get/Set方法没写之外,还有一种情况会导致Action得不到JSP页面中的值(JSP页面用标签textfield 如:),如果在JSP页面中指定了元素的disable属性为true,Action将不会得到页面中这一元素的值,可以通过readonly属性替代。...
ssh整合过程中遇到的问题
1、异常: Line: 230 - com/opensymphony/xwork2/spring/SpringObjectFactory.java:230:-1 原因:出现该异常有两个原因,1.没有使用到spring的jar包  2.没有配置spring监听器 解决方法: 将spring的jar包移除 在web.xml 中配置监听器 &amp;lt;!-- 配置spring配置文件的位置,c...
ssh中jsp页面的dataGrid无法获得数据
action:rn[img=https://img-bbs.csdn.net/upload/201407/15/1405393853_746113.jpg][/img]rn有JSON数据,打印出来:rn[img=https://img-bbs.csdn.net/upload/201407/15/1405393907_865055.jpg][/img]rnstruts.xml:rn[img=https://img-bbs.csdn.net/upload/201407/15/1405393952_26282.jpg][/img]rnjsp:rn[img=https://img-bbs.csdn.net/upload/201407/15/1405394003_769559.jpg][/img]rn效果:rn[img=https://img-bbs.csdn.net/upload/201407/15/1405394063_193716.jpg][/img]rnrn大神们来看看是啥原因~
SSH实践过程中遇到的问题
一 报nosuchmethoderror:   org.objectweb.asm.ClassWriter. (Z)V 原因:asm-3.3.jar 与cglib-2.1.3.jar 冲突导致 解决方法: 使用asm.jar  替换asm-3.3.jar ; 从Build Path中删除,将WEB-INF/lib中的文件也删除。 二. 启动tomcat时报User类中 prope
相关热词 c#异步发送kafka c#窗体编号 c# 操作二进制文件 c# 反射 机制 c#线程 窗体失去响应 c#角度转弧度 c# 解析gps数据 c# vs设置 语法版本 c# json含回车 c#多线程demo