struts-1

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

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

How to call struts action from plain javascript file

半腔热情 提交于 2019-12-11 06:07:15
问题 This query is related to struts 1.3. Let's say I have one action called 'getName.do' which is mapped to 'GetName.java' action class. In the dmexecute method of this action class, I am setting one result say String result = Hello; . My query is how I can call this struts action (getName.do?parameter=value) from one of my javascript files. Essentially, I want the value of result , which is Hello , to be present in my javascript file through this getName.do?parameter=value call. How I can make

not able to use bean:define variable in non stuts tags in a jsp page

风流意气都作罢 提交于 2019-12-11 04:43:51
问题 I am able to use "acctNum" inside scriptlet as <%=acctNum %> with in the block of statements inside tag as mentioned in the below code. <logic:greaterEqual name="childArraySize" value="1"> <bean:define id="acctNum" name="overviewSel" property="accountNumber" type="String"/> <logic:equal name="accountNumber" value="<%=acctNum %>"> <bean:define id="STItemIndex" name="ItemIndex"/> <bean:define id="overviewCh" name="overviewSel" type="com.beans.statements.StatementAccount"/> <bean:define id=

ServletActionContext getAction method returns null

此生再无相见时 提交于 2019-12-11 04:24:44
问题 I am using a servlet filter where I am trying to get the action associated with the current request. Relevant sections of my filter: private ServletContext context; public void init(FilterConfig config) throws ServletException { this.context = config.getServletContext(); } protected void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { ServletActionContext actionContext = new ServletActionContext(context, request,

In struts1.2 how to populate dropdown according to database value

瘦欲@ 提交于 2019-12-11 01:34:34
问题 I have a textboxes and one dropdown on html whose value is getting saved to database on clicking save button but on searching for the value all textboxes and radio button are getting populated except the foloowing dropdown .. <td align= "right" nowrap> <html:select property="standard"> <html:option value="I">I</html:option> <html:option value="II">II</html:option> <html:option value="III">III</html:option> ... and for populating the values i am using th following code.. stuform.setStandard(

Java servlet: issue with multipart/form-data form

时间秒杀一切 提交于 2019-12-10 16:46:43
问题 I have a multipart/form-data form with some <input type='text'> and <input type='file'> fields. I use this code List<FileItem> multipartItems = null; boolean isMultipart = ServletFileUpload.isMultipartContent(request); if (!isMultipart) { System.out.println("false"); } else { FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); multipartItems = null; try { multipartItems = upload.parseRequest(request); System.out.println("true "

HTML5 placeholder inside Struts html:text tag

北慕城南 提交于 2019-12-10 14:40:27
问题 I'm using Struts 1.3.10 in a web application, and I want my textfields to have a placeholder. Unfortunately, the current Struts taglib doesn't recognize this attribute, and I would like to avoid using javascript for this if possible. Do you know any solution for this? 回答1: Struts 1 is dead. It hasn't had a release since 2008. I would really think about migrating to a more modern framework. If you're stuck with Struts 1, you could edit the sources yourself, and add a placeholder attribute to

<html:radio> Check radio button default in struts html tag

≯℡__Kan透↙ 提交于 2019-12-10 04:19:12
问题 How to set radio button checked by default in struts html tag ? <html:radio name="RegisterForm" property="Group" value="<%=Contant.Male%>"/><label>Male</label><BR> <html:radio name="RegisterForm" property="Group" value="<%=Contant.Female%>"/><label>Female</label> Here, i have to set Male as default one. Thanks in advance. 回答1: Just make sue that your controller sets the corresponding property in the form before dispatching to the view: form.setGroup(Constant.Male); 来源: https://stackoverflow