struts

Scroll bar for display table

血红的双手。 提交于 2020-01-01 19:39:14
问题 I was wondering how to insert a <DIV> tag in between the pagination bar and the actual TABLE that starts the results display if I have the pagination bar at the top. If I just put the <DIV> tag right before my display:table, it also includes the pagination stuff inside the scroll bar. Also, I cannot figure out how to set the style to TBODY as it is a little bit confusing. I am not sure if you guys wrote this stuff but can you advise me if you have any idea how to achieve this. and my code is

Struts OR Tiles OR ???… JSP template solution

佐手、 提交于 2020-01-01 19:37:27
问题 currently I'm using a JSP templating system which uses this example's lib ("/WEB-INF/tlds/template.tld"). I'm not even sure how it's called. Anyway it seems like it's not too developed, it makes problems with form POST method, I have no idea who made it (just found it) and I've heard about Apache's Struts & Tiles. I'm not even sure that Struts does what I'm talking about. Down to business: A page in my site has this JSP content, that utilizes the template: <%@ taglib uri="/WEB-INF/tlds

How to rename an existing file

吃可爱长大的小学妹 提交于 2019-12-31 05:20:07
问题 I have an existing file in my HDD and I want rename this file. 回答1: Like this: new File(path).renameTo(new File(newPath)); 回答2: You may look at commons-io FileUtils.moveFile. That method tries File.renameTo, and if that fails, tries to copy&delete the file (e.g. when moving from one drive to another). If you use File.renameTo directly (which should suffice if you only want to rename a file in the same directory), make sure you evaluate the returned boolean value! 来源: https://stackoverflow.com

Struts2 tags in divs appear empty

♀尐吖头ヾ 提交于 2019-12-31 05:17:50
问题 I have a s:checkbox inside a html div. When the code is run, the checkbox is outside (both) the div and the divs seem to be empty and nonexistant. Why is this occuring and how can I fix it? When I place random text inside either div, the div contains it. I set the background color to red so I can detect the div. <div id="outer"> <div id="inner"> <s:checkbox name="chBx" id"chBx" fieldValue="false" value="true" label="Check This" /> </div> </div> 回答1: Like described in this answer (that you

Using Hibernate session with quartz

百般思念 提交于 2019-12-30 06:27:34
问题 I've a web application which uses framework like Struts and Hibernate. Currently I'm developing a scheduler for this application using Quartz. While coding I realized that the use of Hibernate session is not possible with the threads of Quartz. Anybody have a solution for using hibernate sessions from quartz job class? 回答1: One approach is to use a HibernateUtil class which builds the SessionFactory in a static initializer and makes it available via a public static getter. Your Quartz job can

AJAX file upload/form submit without jquery or iframes?

别说谁变了你拦得住时间么 提交于 2019-12-30 03:22:08
问题 Is it possible to do an AJAX form submit without jQuery or IFrames (so just pure JavaScript)? I'm currently sending to a struts fileUploadAction that works. Would the action's code still work with the asynchronous submit, or are there additions required to pick up the async form submit? I am using struts 1.x and current my form is: <html:form action="fileUploadAction" method="post" enctype="multipart/form-data"> ...form elements... <html:file property="theFile" /> ...other elements... </html

Prevent IE caching

非 Y 不嫁゛ 提交于 2019-12-29 14:32:27
问题 I am developing a Java EE web application using Struts. The problem is with Internet Explorer caching. If an user logs out he can access some pages because they are cached and no request is made. If I hit refresh it works fine. Also if an user goes to login page again it won't redirect him because that page is also cached. Two solutions come to my mind: Writing an Interceptor (servlet filter like) to add to response header no-cache etc. Or or put <meta> tags at each page. Which one should I

Prevent IE caching

不打扰是莪最后的温柔 提交于 2019-12-29 14:32:15
问题 I am developing a Java EE web application using Struts. The problem is with Internet Explorer caching. If an user logs out he can access some pages because they are cached and no request is made. If I hit refresh it works fine. Also if an user goes to login page again it won't redirect him because that page is also cached. Two solutions come to my mind: Writing an Interceptor (servlet filter like) to add to response header no-cache etc. Or or put <meta> tags at each page. Which one should I

How to get json object using its key value in Struts?

北慕城南 提交于 2019-12-29 08:25:54
问题 I am working on web services in struts. Now I want json object using its key value. Then I have to post something like array in response. I have no idea how to do that in Struts. I know how to do it in Servlets. So, I am using the following code I have tried, but I think it is different in Struts. JSONObject json = (JSONObject)new JSONParser().parse(jb.toString()); String key_value= json.get("key").toString(); So, how to do it in Struts. Please also tell me how to parse json array in response

How to prevent JPA from rolling back transaction?

别等时光非礼了梦想. 提交于 2019-12-29 06:15:48
问题 Methods invoked: 1. Struts Action 2. Service class method (annotated by @Transactional) 3. Xfire webservice call Everything including struts (DelegatingActionProxy) and transactions is configured with Spring. Persistence is done with JPA/Hibernate. Sometimes the webservice will throw an unchecked exception. I catch this exception and throw a checked exception. I don't want the transaction to roll back since the web service exception changes the current state. I have annotated the method like