action

DWR与Strut2的Action冲突问题

早过忘川 提交于 2019-12-07 13:12:29
DWR与Strut2整合后,当运行 http://localhost:8080/工程名称/dwr 测试暴露的方法时,就会出现如下错误: “There is no Action mapped for namespace / and action name dwr.” 要解决这个问题,首先要了解一下: 1、Struts2在web.xml中配置为“/*”和“*.action,*.jsp”的差别 Struts2在web.xml中配置过滤器的方法有2种方式: 一种为: <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> 另一种为: <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> 解析:假如配置方式是 *.action 的话,一般应当同时配置 *.jsp

UIAlertView buttons action code

假装没事ソ 提交于 2019-12-07 12:35:19
问题 Do anyone know how to make actions for the buttons in UIAlertview ? if so, please guide me. 回答1: - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger) buttonIndex { if (buttonIndex == 0) { NSLog(@"Cancel Tapped."); } else if (buttonIndex == 1) { NSLog(@"OK Tapped. Hello World!"); } } Try This Code It Will Works for you... 回答2: When buttons are clicked in UIAlertView, its delegate method - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger

Java JButton.setAction(…) null's button text

☆樱花仙子☆ 提交于 2019-12-07 09:20:03
问题 The following code renders a JButton without text: public abstract class Test { public static void main(String... args) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { e.printStackTrace(); } SwingUtilities.invokeLater(() -> { JFrame frame = new JFrame(); JPanel panel = new JPanel(); String text = "Invisible"; JButton button = new JButton(text);

does passing a method of one object to another object keep the first object alive?

心已入冬 提交于 2019-12-07 06:27:12
问题 Suppose I have three objects: 'a', 'b' and 'c'. Object 'a' and 'c' are long-lived, statically referenced service singletons. Object 'b' is short-lived, i.e. no static references keep it alive. Now suppose object 'a' creates an instance of object 'b' in the scope of one of its methods, e.g. B b = new B(); Further suppose that the class B looks something like this: public B () { C.ActionList.Add ( SomeMethod ); } void SomeMethod () { ... } Now, how long does object 'b' live? My presumption is

Check for active internet connection with Applescript/Automator

て烟熏妆下的殇ゞ 提交于 2019-12-07 04:56:10
问题 I have an Automator workflow to ping a server, and download the latest copy of a schedule that I frequently use. This schedule then is copied to my dropbox so I can view it on my phone. Before the workflow downloads the newest schedule it deletes the old schedule from dropbox. This works well, except when I don't have an active internet connection. When I don't have an active internet connection, the workflow will still open up dropbox, delete the old schedule, and try to download the newest

MVC Action taking a long time to return

亡梦爱人 提交于 2019-12-07 02:41:26
I have an MVC Controller with an action public ActionResult GeneratePDF(string id) { FileContentResult filePath = this.File(pdfBuffer, MediaTypeNames.Application.Pdf); return filePath; } And for some reason it is taking over 20 seconds when it hits the return line. The pdfBuffer is working okay, and when I run it on my VS all is okay, but when I deploy to IIS 6 it runs slow. Anyone know why? I was running into a similar issue when trying to export to XLS and PDF, the only thing that seem to improve the response time was sending the response directly from the class that generates the file like:

Action with a string array as parameter

不羁岁月 提交于 2019-12-07 01:34:35
问题 I want to call an action with something similar to this uri: http://server/controller/action/?columns=firstname&columns=lastname&columns=age and use it like this: public ActionResult Action(string[] columns) { } how do I do it? 回答1: Google is my friend ;) http://server/controller/action/?columns[]=firstname&columns[]=lastname&columns[]=age Edit: Actually you just write as I did in my original question. The reason to why I didn't get it working in the first place is that I used "column" in the

BroadcastReceiver详解

◇◆丶佛笑我妖孽 提交于 2019-12-07 01:14:41
二、注册相关 1、静态注册实例程序 大家可能会问,什么叫静态注册实例程序,先不要管上面的标题,慢慢往下看,后面在讲动态注册时会再提到。 先构造一个接收器: [java] view plain copy public class MyReceiver extends BroadcastReceiver { private static final String TAG = "MyReceiver"; @Override public void onReceive (Context context, Intent intent) { // TODO Auto-generated method stub String msg = intent.getStringExtra("msg"); Log.i(TAG, "MyReceiver:"+msg); } } 直 接派生自BroadcastReceiver,在OnReceive()函数中进行处理即可,我们前面说了,广播的传递是靠Intent 的,OnReceive的第二个参数,就是广播传过来的Intent,因为后面我们在发送广播时,会利用PutStringExtra放进去一个标识为 msg的字符串,所以这里我们可以利用GetStringExtra把这个字符串取出来。然后用Log标记下这个类接收到了这个消息,以便我们跟踪。 大家可能会想

struts.convention.result.path is not working in Struts2

一曲冷凌霜 提交于 2019-12-06 21:19:25
My current project structure is as follows WebContent WEB-INF View TestPage.jsp other JSP pages... My assignment is to put all JSP pages inside folder WEB-INF and do all relative changes in the project. WebContent WEB-INF View TestPage.jsp other JSP pages... So I have to update all result tag in struts.xml <result name="success">/View/TestPage.jsp</result> to <result name="success">/WEB_INF/View/TestPage.jsp</result> After search on web I found a plugin - struts convention plugin to achieve this, But it follows its Naming convention. Can I override Struts convention plugin configuration (that

Spark中执行transformation和action的区别

百般思念 提交于 2019-12-06 20:21:07
1,transformation是得到一个新的RDD,方式很多,比如从数据源生成一个新的RDD,从RDD生成一个新的RDD 2,action是得到一个值,或者一个结果( 直接将RDDcache到内存中 ) 所有的transformation都是采用的懒策略,就是 如果只是将transformation提交是不会执行计算的,计算只有在action被提交的时候才被触发 。 从运行层面来看,Transformation实际上是一种链式的逻辑Action,记录了RDD演变的过程。Action则是实质触发Transformation开始计算的动作,由于在每个Transformation的过程中都有记录,所以每个RDD是知道上一个RDD是怎样转变为当前状态的,所以如果出错就可以很容易的重新演绎计算过程。 Reference: 1. http://blog.csdn.net/map_lixiupeng/article/details/41958561 2. http://www.dataguru.cn/thread-588091-1-1.html 3. http://my.oschina.net/hanzhankang/blog/200275 来源: oschina 链接: https://my.oschina.net/u/2243330/blog/633058