struts

struts select tag with values of a array list

為{幸葍}努か 提交于 2019-11-26 17:52:26
问题 I am developing a simple struts application. In my JSP I have a dropdown list box (using s:select tag). I need to fill the values with a arraylist values in the action class. How can I do that? what changes needed in the structs.xml file for complete this? JSP: <s:select name="department" label="" list="departmentlist" headerKey="-1" headerValue="Select Department"> Action class: private List<String> departmentlist = new ArrayList<String>(); public String xyz() { departmentlist.add("aaa");

Mark一下,关于Struts开源框架学习

巧了我就是萌 提交于 2019-11-26 16:36:54
由于本书尚未出版,我在这里只能给出部分样章供大家参考。 《Struts2技术内幕》 新书部分篇章连载(一) 《Struts2技术内幕》 新书部分篇章连载(二) 《Struts2技术内幕》 新书部分篇章连载(三) 《Struts2技术内幕》 新书部分篇章连载(四) 《Struts2技术内幕》 新书部分篇章连载(五) 对于样章的选择,我在这里给出我的理解。 第一,许多读者对如何学习Struts2,如何学习开源框架的问题最感兴趣。因此我摘录了书中第二章最后一节的内容作为样章供读者参考。 第二,要理解Web开发,应该首先建立起面向对象的思想观念。面向对象这个话题很大,我也不可能面面俱到,我的水平或许也不足以讲清楚。所以在书 中我采取的方式是针对一个特定的话题来讲:对象的构成分析。而这部分内容也在本书的第二章第一节中,作为样章的一部分给出大家。大家千万不要小看这一节, 因为这一节中所提到的概念,实际上是整个Java领域中一些核心问题的汇总。看似简单的概念,背后可以延伸出来的内容非常多。在我的整个书中,这部分内容 将被反复提及并作为重要的立论依据。 第三,我将本书的第三章中的“多角度透析Struts2”作为样章的一个重要原因是帮助读者理顺Struts2这个框架的大致内容。因为有许多读 者会提出这样的问题:我想看Struts2的源码,不知道如何入手。在这一篇样章中,我将首先从宏观的角度

Address already in use: JVM_Bind java

与世无争的帅哥 提交于 2019-11-26 15:57:50
问题 Some times whenever I restart the application, which is built on Java Struts Mysql and Jboss 4.05 Version I get the error as Address already in use: JVM_Bind Only fix that i know is to restart the machine and try again, it will work. Else Some times I do Ctrl-Alt-Del and Stop all the process related to Java, some times this also works. But what is the exact reason and how can we prevent this problem ? 回答1: Address already in use: JVM_Bind means that some other application is already listening

Where are compiled JSP Java (*__jsp.java) files?

青春壹個敷衍的年華 提交于 2019-11-26 14:33:59
I am getting a javax.servlet.jsp.JspException in one of the jsp files that my website is trying to render ( survey.jsp ). However, the stack trace does not give me the the specific line in jsp where it fails but rather the line number where it fails in ( survey_jsp.java:787 ), which seems to be the compiled JSP file. Where do I find such files, so that I know what line is throwing this exception? Thanks EDIT: These files live in the /work directory if you are using tomcat as Will suggested in the comment below. BalusC The compiled JSP files are by default available in the /work folder of the

How to fetch hibernate query result as associative array of list or hashmap

故事扮演 提交于 2019-11-26 13:59:26
问题 I am developing an application in struts 2 and hibernate 3. I have 3 tables Inspection InspectionMission Timeline Inspection is associated with InspectionMission and InspectionMission is associated with Timeline . Now I have following problem. I have written following query in HQL public List getQuartewiseInspectionList(){ Session session = HibernateUtil.getSessionFactory().getCurrentSession(); Query q = session.createQuery( "select count(i.inspectionId) as tot_inspections,t.year,t.quarter" +

How can I set the welcome page to a struts action?

匆匆过客 提交于 2019-11-26 12:37:34
问题 I have a struts-based webapp, and I would like the default \"welcome\" page to be an action. The only solutions I have found to this seem to be variations on making the welcome page a JSP that contains a redirect to the action. For example, in web.xml : <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> and in index.jsp : <% response.sendRedirect(\"/myproject/MyAction.action\"); %> Surely there\'s a better way! 回答1: Personally, I'd keep the same setup you have now

AJAX vs Form Submission

青春壹個敷衍的年華 提交于 2019-11-26 11:21:56
问题 We pull data from server and for that If we are using Struts, then we can pull either by submitting a page which MVC Architecture or we cam make an AJAX call but conventions is of using forms and render response but we also face challenges to give rich user experience, so we compromise convention and start using excessive AJAX, so how we should make balance between two? 回答1: I personally think that AJAX should be used for displays updates and form submissions should be done via a page reload.

Getting a &#39;No thread-bound request found&#39; error from spring in my web app

≯℡__Kan透↙ 提交于 2019-11-26 09:41:43
问题 I\'m getting a \'No thread-bound request found\' error in my web app and hoping to get some help. I\'m trying to use struts2 + spring + hibernate, and use spring to manage the hibernate session factory, and inject hibernate sessions into my struts actions. I hope that made sense. When the app starts up, there are no errors, but when i make the first web request it bombs out with the \'No thread-bound request found\' error. Here\'s my spring config: <?xml version=\"1.0\" encoding=\"UTF-8\"?> <

Where are compiled JSP Java (*__jsp.java) files?

此生再无相见时 提交于 2019-11-26 05:56:08
问题 I am getting a javax.servlet.jsp.JspException in one of the jsp files that my website is trying to render ( survey.jsp ). However, the stack trace does not give me the the specific line in jsp where it fails but rather the line number where it fails in ( survey_jsp.java:787 ), which seems to be the compiled JSP file. Where do I find such files, so that I know what line is throwing this exception? Thanks EDIT: These files live in the /work directory if you are using tomcat as Will suggested in