读书人

项目好好的忽然就Unknown tag (s:fo

发布时间: 2012-12-22 12:05:07 作者: rapoo

项目好好的,突然就Unknown tag (s:form).不知道为什么。
项目好好的,突然就Unknown tag (s:form).不知道为什么。

[最优解释]
他都说了 未知名的标签了。
[其他解释]
如果照楼上所说的话,楼主去项目的jar包那里右击,找到build path,里面的configure build path,进去后看看jar包对不对。其实我觉得是不是你对应的jsp里面没有导入struts标签啊,<%@ taglib uri="/struts-tags" prefix="s"%>这句话有没有?
[其他解释]
重新编译一下?
[其他解释]
Spring中hibernate映射没配置好啊
[其他解释]
structs2标签只能从action跳转过来才能编译,直接访问jsp不行.不知道是不是你的问题
[其他解释]
[amigo/sshmemo/dao/User.hbm.xm] cannot be opened because it does not exist

映射文件User.hbm.xml
[其他解释]
看看导入 类库没。
[其他解释]
我用myeclipse10搭建的ssh web工程,运行正确,各种包都有的。

开始写JSP页面的时候,用S标签都还有提示。后来好像是报了个错,然后JSP页面也跟着找不到标签了。
[其他解释]
你的包重新引过应该就行了吧,我想啊
[其他解释]
我重新部署项目也不行啊。这个问题困扰我很久了啊 不知道怎么解决!
[其他解释]
包没有什么不对啊,因为之前我用这些标签都没问题,也没改动,好像就是报个错,然后就这样了。
<%@ taglib uri="/struts-tags" prefix="s"%>这句话肯定有撒,不然之前怎么能正常使用。
[其他解释]
报错。
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [amigo/sshmemo/dao/User.hbm.xm] cannot be opened because it does not exist


Caused by: java.io.FileNotFoundException: class path resource [amigo/sshmemo/dao/User.hbm.xm] cannot be opened because it does not exist

这2个错。。。
[其他解释]
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">


<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<bean id="testImp" class="util.TestImp">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="testAction" class="action.TestAction">
<property name="testFace" ref="testImp">
</property>


</bean>

<bean id="userDao" class="dao.UserDao"><property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="loginAction" class="action.LoginAction">
<property name="loginFace" ref="userDao"></property>
</bean>
</beans>



说实话 我是不懂这个东东。。。哪有问题么。。
[其他解释]
错了 不是上面那个。。。是这个 。。

<?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:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">


<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">

<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>

<property name="url"
value="jdbc:mysql://localhost:3306/sshmemo">
</property>

<property name="username" value="root"></property>
<property name="password" value="root"></property>
</bean>

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

<property name="dataSource">
<ref bean="dataSource" />
</property>

<property name="mappingResources">
<list>
<value>amigo/sshmemo/dao/User.hbm.xm</value>
<value>amigo/sshmemo/dao/Memo.hbm.xm</value>
<value>amigo/sshmemo/dao/memoType.hbm.xm</value>
</list>
</property>

<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="show_sql">true</prop>
<prop key="hibernate.jdbc.batch_size">20</prop>
</props>
</property>
</bean>

<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>

<bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="transactionInterceptor"/>
<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
<prop key="login*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>

<bean id="beanNameAutoProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<!-- 需要自动创建事务代理的bean -->
<value>*Dao</value>
</list>
<!-- 此处可增加其他需要自动创建食物代理的bean -->
</property>

<property name="interceptorNames">


<list>
<value>transactionInterceptor</value>
</list>
</property>

</bean>

<bean id="baseDao" class="amigo.sshmemo.dao.BaseDaoImpl">

<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>

<bean id="userManager" class="amigo.sshmemo.service.user.UserManagerImpl">
<property name="dao">
<ref bean="baseDao"/>
</property>
</bean>

<bean id="userAction" class="amigo.sshmemo.service.user.UserAction">
<property name="userManager">
<ref bean="userManager"/>
</property>
</bean>

</beans>
[其他解释]
映射文件User.hbm.xml
在里面啊。。。
[其他解释]
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>

<constant name="struts.custom.i18n.resources" value="validationMessages"/>
<constant name="struts.locale" value="zh_CN"/>
<constant name="struts.i18n.encoding" value="utf-8"/>

<include file="struts-default.xml"/>
<package name="amigo" extends="struts-default">
<action name="*UserAction" class="userAction" method="{1}">
<result name="list">/user/userList.jsp</result>
<result name="update">/user/updateUser.jsp</result>
<result name="main">/user/main.jsp</result>
<result name="login">/user/login.jsp</result>
<result name="success">/success.jsp</result>
<result name="error">/errot.jsp</result>
</action>
</package>

</struts>


这个应该也没问题啊

applicationContext.xml里面要怎么配置啊

读书人网 >Java Web开发

热点推荐