Re: Struts 2, file tag, accept attribute not working?
Martin, Thanks for the response but unless I am missing something how do you expect this to work? > if("%{uploadContentType}%"=="'text/xml'") When this server side code runs you dont have any information about what the user is going to upload.. Has anyone got accept or size attribute of s:file tag to work? Thanks, Amit. -- Forwarded message -- From: "Martin Gainty" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Date: Wed, 12 Dec 2007 21:59:17 -0500 Subject: Re: Struts 2, file tag, accept attribute not working? you can hook the submit event to JS function and then test the content type before submitting function doSubmit() { if("%{uploadContentType}%"=="'text/xml'") { document.form.action="WhateverAction"; document.form.submit(); } } - Original Message - From: "Amit Rana" <[EMAIL PROTECTED]> To: Sent: Wednesday, December 12, 2007 5:48 AM Subject: Re: Struts 2, file tag, accept attribute not working? > Hi Anton, > Were you able to finally get it to work? > > I am using 2.0.9 and accept just doens't seem to be doing anything. > > Regards, > Amit. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2, file tag, accept attribute not working?
Hi Anton, Were you able to finally get it to work? I am using 2.0.9 and accept just doens't seem to be doing anything. Regards, Amit. >Re: Struts 2, file tag, accept attribute not working? > >Anton Pussep >Sat, 03 Nov 2007 10:09:23 -0800 > >Modifying FileUploadInterceptor or settings its parameters in struts.xml >is not a proper solution since I have two s:file fields in my form and >both require different content types. I am not looking for a work >around, I rather have the question: > >Is the accept attribute working at all and if it does, why isn't it >working for me? > >Best, >Anton >>> - Original Message - >>> From: "Anton Pussep" <[EMAIL PROTECTED]> >>> >>> To: "Struts Users Mailing List" >>> Sent: Friday, November 02, 2007 6:03 AM >>> Subject: Struts 2, file tag, accept attribute not working? >>> >>> Hello, I am using the following tag for uploading text files: I expected it to recognise wrong content types, but it accepts any > files I upload. What might be the problem here? I tried this with Struts 2.0.9 and 2.0.11. Best, Anton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts] action and method separator using something other than action!method
>From: Omkar patil >Amit, > >I am not sure if there is any easy way to achieve this. Is there any >specific reason you would like achieve this? One way could be provide >your own action mapper class by extending DefaultActionMapper and >overriding getUriFromActionMapping method to provide your own separator. Thanks for responding. I want to use / as separator so that my urls are of form http://server/app/action/method for eg user/view user/add etc I will try creating my own action mapper and give it a try, I might also try creating my own tag which uses/extends s:url - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
action and method separator using something other than action!method
Hi, I have a url for login This generates a url like http://localhost:8080/myapp/login!input.action Is there a way to tell s:url to use _ or / as separator and not ! Thanks, Amit. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Tiles decoration and struts2
-- Raghuveer Rawat wrote -- >Amit, >looks like problem is with your struts.xml. You have set Tiles Result but >your result is jsp page. I think you need to change it to tile definition. Hi, Thanks for the response. Thats not my problem. I do not need TilesDecorationFilter for that. Tiles result type is already working. I want to avoid creating definitions for every screen like you created for "home". I want result of the action to be automatically rendered without having to create the screen definition. Regards, Amit. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Tiles decoration and struts2
>I suppose that it is a Tiles issue. >I must admit that the code inside the TilesDecorationFilter does not >convince me... Amit, can you repost this question to the Tiles Users Mailing >list? I think that it is a Tiles bug. >http://tiles.apache.org/mail.html >Thanks >Antonio Hi, Thanks, I have posted on Tiles list. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with Tiles decoration and struts2
Hi, I am trying to get TilesDecorationFilter (http://tiles.apache.org/tutorial/advanced/utils.html) to work with struts2.0.9 without any success. Can anyone please help me figure out where am I going wrong? I am not sure if this is a tiles list question or struts? Tiles is decorating jsps but not the out put from an action. If I access jsp/home.jsp it comes with the layout but home.action only prints layout and result of action is not seen anywhere. There are no errors. Kindly advice. web.xml http://www.w3.org/2001/XMLSchema-instance"; xmlns="http://java.sun.com/xml/ns/javaee"; xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; id="WebApp_ID" version="2.5"> MyApp org.apache.struts2.tiles.StrutsTilesListener struts2 org.apache.struts2.dispatcher.FilterDispatcher tilesdecoration org.apache.tiles.web.util.TilesDecorationFilter definition blank attribute-name body struts2 /* tilesdecoration /* home.action struts.xml jsp/home.jsp tiles.xml http://tiles.apache.org/dtds/tiles-config_2_0.dtd";> blankLayout.jsp <%@ taglib uri="http://tiles.apache.org/tags-tiles"; prefix="tiles" %> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]