struts

“title” attribute for <html:options> struts tag

风格不统一 提交于 2019-12-12 01:17:56
问题 In a regular select box you can show the full title on mouseover using "title" attribute in the "option" field. In Apache Struts, you make the select box with the "html:options" tag. I don't think this tag supports the "title" attribute. Is there another way to show the full title of an option on mouseover for the "html:options" struts tag? Thanks 回答1: Struts' tag for <select><option> .. is <s:select /> , or <s:doubleselect /> for double lists. <s:doubleselect /> doesn't support title at all,

Alternative for JavaScript onUnload

穿精又带淫゛_ 提交于 2019-12-11 23:27:57
问题 there is an alternative to the Javascript onUnload ? I use JSP Jakarta Struts framework with a Servlets . I must know, when is window closing, because not everyone clicks on Logout button. How do you handle it in your applications? 回答1: Generally speaking, it's impossible to determine conclusively whether a visitor is still "using" (or even looking at) your page. Once the browser has downloaded the page, it's no longer in contact with the server at all, so the page could stay open for a few

Struts2 dojo Anchor tag does not work?

孤街醉人 提交于 2019-12-11 22:14:51
问题 Tag <sx:head /> is present on the page. I try to update content of div: <div id="div1"> ... </div> <s:url id="ajaxData" value="/ajaxData.action" /> <sx:a id="link1" href="%{ajaxData}" targets="div1"> update data </sx:a> action public String execute() { ... return NONE; } xml <action name="ajaxData" class="com.data.action.AjaxDataAction"> <result name="none">/page.jsp</result> </action> But when I press update data the browser tab shows animation, it means that whole page updates? It reloads

struts html:link custom attribute

て烟熏妆下的殇ゞ 提交于 2019-12-11 19:22:13
问题 I'm trying to use Apache Struts with BootStrap css which uses the custom css attibute data-toggle="dropdown" for its menus. I tried with <html:link action="/Home" styleClass="dropdown-toggle" data-toggle="dropdown"> <bean:message key="menu.person" /> </html:link> However data-toggle="dropdown" is not allowed, in NetBeans it gives error: Attribute data-toggle invalid for tag link according to TLD How do I put a custom property like data-toggle inside an <html:link> ? So far I can see only id

Getting Shibboleth Attributes through Struts-1

安稳与你 提交于 2019-12-11 17:57:01
问题 I'm trying to integrate Shibboleth authentication with an old Struts-1 application that I've inherited the maintenance of, but I cannot figure out how to acecss the Shibboleth attributes. This is what I have tried: public final class AuthenticateAction extends MappingDispatchAction { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { Enumeration attributeNames = request.getAttributeNames(); while

Using jQuery validation plugin with a form written in struts

ぐ巨炮叔叔 提交于 2019-12-11 17:40:13
问题 I want to implement the jQuery validation plugin for use in a web application written in java and struts. I just want to use it to validate form inputs to see if they conform to certain rules before it's submitted to a database. The project I'm trying to implement this in was written by someone else, I don't have access to them, and I can't rewrite it. Here is one of the form inputs that I want to validate: <html:text property="groomFirstName" maxlength="30" tabindex="1" styleId=

Iframe not showing object from struts action class

橙三吉。 提交于 2019-12-11 17:24:16
问题 This is in continuation with my previous question which was not framed properly. I have an iframe in a jsp class which is calling a struts2 action class in its src, but instead of opening inside the frame the file is getting downloaded, Inside file TempContentPage.jsp: <s:form> <iframe id="displayFrame" src="ContentPage.action" width="1000" height="500" FRAMEBORDER="0" value="1"> </iframe> </s:form> Here is the execute method in the action class ContentPage.java public String execute() throws

How to concatenate 2 action class variables in Struts 2?

China☆狼群 提交于 2019-12-11 16:46:19
问题 I have 2 variable in my action class, id1 and id2 . Joined by a _ , they're used as a map key. I am not able to retrieve the map value using this code: <s:property value="%{mymap[id1_id2]}" /> How should I retrieve the map value? 回答1: The expression id1_id2 in OGNL will assume the presence of a variable named id1_id2 , since it's a perfectly legal identifier. If you want to concatenate strings, you'd need: <s:property value="%{mymap[id1 + '_' + id2]}" /> I'd likely create a separate variable

NullPointer Exception in Struts application

落爺英雄遲暮 提交于 2019-12-11 16:19:39
问题 I want to create a struts app which displays index.jsp file which contains link to the search.jsp file.Directory structure of Struts 1.2 app is as below Struts 1.2 Directory Listing The content of web.xml is as below <display-name>MiniHR</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <jsp-config> <taglib> <taglib-uri>http://struts.apache.org/tags-html</taglib-uri> <taglib-location>/WEB-INF/lib/struts-html.tld</taglib-location> </taglib> </jsp