哪个最好,换句话说,最简单易用?条纹或JSF.
虽然我没有在愤怒中使用这两者,但我需要评估什么是开始新项目和转换现有Struts项目的最佳选择.
我担心JSF不会像我想的那样渲染,但是其他经历是什么?看起来条纹更直接,我在这个假设中是否正确?
我对Spring MVC很有经验,我正在尝试Stripes来决定是否尝试新项目.
在Spring MVC中,我将准备模型数据并将其传递给视图,方法是将其添加到由我的控制器创建的ModelAndView实例中的地图上.我无法为Stripes找到相同的东西.
似乎最接近的并行是让ActionBean准备我的模型数据并将其添加到HttpSession.ForwardRedirect用于加载视图,并从会话中访问数据.
是否有更好的支持Stripes提供的前端控制器,或者这是一个完全不同于Spring MVC的设计原理?(即我必须使用EL调用视图中的方法来检索数据,如某些示例所做的那样)
谢谢!
我正在使用 <detail:form>
并<tags:field >
在我的jsp页面中.我试图查看浏览器使用firebug生成的源代码,它向我显示表单名称为" checkForm ",所有字段名称都有"check".作为前缀.因此,该字段之一(它是一个单选按钮)名称是check.isEndorseByApplicant
.
我想要实现的是,当选择下拉菜单中的某个元素时,我想将单选按钮从yes更改为no.问题是因为该字段在其名称中包含点,我不能这样做.即document.checkForm.check.isEndorseByApplicant不适合我.我现在无法从该字段的名称中取出点.有任何想法吗?
function autoSelect(checkEndorsement)
{
alert(document.checkForm.check.isEndorseByApplicant)
if(checkEndorsement.value=="Student")
check.isEndorsedBy[0].checked=true;
else
check.isEndorsedBy[1].checked=true;
}
</html:javascript>
Run Code Online (Sandbox Code Playgroud)
...
<detail:form object="check" >
Run Code Online (Sandbox Code Playgroud)
....
<td><tags:field property="isEndorseByApplicant" onclick="autoSelect(this.form);" /></td>
Run Code Online (Sandbox Code Playgroud) 我正在编写一个简单的应用程序,让用户上传图像.上传后,用户可以标记或删除它们.
我想出了如何上传文件并在文件上传后保存它们.我一直在跟踪保存图像的全局路径.在数据库中,我保留有关图像的元数据,如文件名,标签等.
我正在使用Java/JSP(特别是Stripes框架,但我的问题是通用的).
我的问题是,一旦上传这些图像文件,我该将它保存在哪里?
现在我在Tomcat服务器上部署了两个Web应用程序.一个主要的Web应用程序和另一个是我上传图像的位置.
但这不起作用,因为在重新部署/重新启动Tomcat之前,我无法在主应用程序中看到上传的图像.
似乎Tomcat不会自动选择新上传的图像.
有没有人有任何解决方案?
这是一个简单的项目,所以我不想将它们存储在数据库中或使用Apache来存储图像.对于这个小项目来说,这一切都太复杂了.
谢谢.
我正在研究Fred Daoud的Stripes一书,并尝试将Hello World应用程序转换为使用友好URL,因为我不喜欢基于后缀的映射,例如http:// localhost:8080/getting_started/Hello.action.
这是之前...
的index.jsp:
<jsp:forward page="/Hello.action"/>
Run Code Online (Sandbox Code Playgroud)
web.xml中:
<servlet-mapping>
<servlet-name>DispatcherServlet</servlet-name>
<url-pattern>*.action</url-pattern>
</servlet-mapping>
Run Code Online (Sandbox Code Playgroud)
我的HelloActionBean上没有UrlBinding.我有书的例子.
我想知道这些书的例子是否适合早期版本的Stripes,因为我已经下载了1.5.1,我的web.xml定义了StripesFilter和StripesDispatcher,而我看到了其他地方使用过的DynamicMappingFilter,例如Fred的这篇文章在TheServerSide上.
无论如何,我做了以下更改:
的index.jsp:
<jsp:forward page="/hello"/>
Run Code Online (Sandbox Code Playgroud)
web.xml中:
<servlet-mapping>
<servlet-name>DispatcherServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Run Code Online (Sandbox Code Playgroud)
HelloActionBean.java:
**@UrlBinding("/hello")**
public class HelloActionBean implements ActionBean
{
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试通过http:// localhost:8080/getting_started加载应用程序时,我看到:
net.sourceforge.stripes.exception.ActionBeanNotFoundException: Could not locate an ActionBean that is bound to the URL [/]. Commons reasons for this include mis-matched URLs and forgetting to implement ActionBean in your class. Registered ActionBeans are: {/hello=class stripesbook.action.HelloActionBean, /controller/DefaultView.action=class net.sourceforge.stripes.controller.DefaultViewActionBean, /hello/=class stripesbook.action.HelloActionBean, /controller/DefaultView.action/=class net.sourceforge.stripes.controller.DefaultViewActionBean}
at …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Java和Stripes Framework开始开发.我的web.xml文件中有以下内容
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>
<filter>
<filter-name>StripesFilter</filter-name>
<filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
<init-param>
<param-name>ActionResolver.Packages</param-name>
<param-value>
pdapm.action
</param-value>
</init-param>
<init-param>
<param-name>Extension.Packages</param-name>
<param-value>
pdapm.extensions, org.stripesbook.reload.extensions
</param-value>
</init-param>
</filter>
<filter>
<filter-name>DynamicMappingFilter</filter-name>
<filter-class>net.sourceforge.stripes.controller.DynamicMappingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>DynamicMappingFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
Run Code Online (Sandbox Code Playgroud)
我收到错误:
The requested resource ... is not available.
Run Code Online (Sandbox Code Playgroud)
有什么我需要添加或我应该尝试修复与tomcat相关联的任何东西.我使用tomcat插件来xampp.我是初学者,所以这可能是一个简单的错误或跳过步骤.我只是想朝着正确的方向努力.
[21:44:14] WARN net.sourceforge.stripes.util.ResolverUtil - Could not examine class
'pdapm/action/BaseActionBean.class' due to a java.lang.UnsupportedClassVersionError
with message: Bad version number in .class file (unable to load class
pdapm.action.BaseActionBean)
[21:44:14] …
Run Code Online (Sandbox Code Playgroud) 任何人都可以帮助我使用Java Framework - 条带?我尝试上传图像stripes:file
,在服务器上调整大小并返回新的StreamingResolution
返回("image/jpeg"...我现在不知道如何发送StreamingResolution
以及如何stripes:file
在jsp上的元素之后加载图像?
非常感谢
我试图更改错误消息的颜色.我正在使用Stripes验证.如果验证失败,我发送错误消息.我想要它是红色的.但它显示为黑色.如何在Stripes框架中更改错误消息的颜色.
以下是我的尝试.
<div class="item">
<stripes:errors />
<stripes:form name="home"action="/home.action">
//contents
</stripes:form>
</div>
Run Code Online (Sandbox Code Playgroud) 由于条纹带有共同记录.在没有公共日志记录的情况下,在Web应用程序中使用条带有哪些选择.如何用sl4j日志库替换它?
stripes ×10
java ×9
jsp ×2
file-upload ×1
forms ×1
html ×1
java-ee ×1
javascript ×1
jsf ×1
radio-button ×1
tomcat6 ×1
web.xml ×1