parameter-passing

How to wtite pretty URL in Struts2.x?

◇◆丶佛笑我妖孽 提交于 2019-12-01 14:01:25
I want to rewrite my URL in Struts2. Please help me out to do this. How can i customize as i want, i don't want to show my parameter that i am passing and also show action with different name that i want I don't know how to do it. i have to use plugins for that or configure my code in struts.xml <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.action.extension" value="action" /> <constant name="struts.enable.DynamicMethodInvocation" value="false" /> <constant name="struts

Passing an *Awaitable* Anonymous Function as a Parameter

六眼飞鱼酱① 提交于 2019-12-01 13:41:16
问题 Code first. This is what I'm trying to do. I'm close, but I think I just need to fix the way I've defined my parameter in the UpdateButton method. private async void UpdateButton(Action<bool> post) { if (!await post()) ErrorBox.Text = "Error posting message."; } private void PostToTwitter() { UpdateButton(async () => await new TwitterAction().Post("Hello, world!")); } private void PostToFacebook() { UpdateButton(async () => await new FacebookAction().Post("Hello, world!")); } Unfortunately,

Invoking a p:remoteCommand via a JavaScript function passing a message local to that function to another function through the “oncomplete” handler

不想你离开。 提交于 2019-12-01 12:55:59
This question is purely based on this previously asked question ( courtesy ) but the question is messed up completely with the Java EE 7 WebSockets API attempting to show the actual practical approach/scenario which is now very unlikely to receive any answer based on <p:remoteCommand> . Given below a snippet of JavaScript (this is only a test scenario). <script type="text/javascript"> function test() { var message = "myMessage"; window["myFunction"](); // This is literally interpreted as a JavaScript function "myFunction()". // "myFunction()" in turn is associated with a <p:remoteCommand>. } $

'kubectl patch' works on Linux Bash but not in Windows Powershell ISE

吃可爱长大的小学妹 提交于 2019-12-01 11:32:49
The following command works fine on Ubuntu bash: kubectl patch deployment wapi-backend-d1 --patch '{"spec": {"template": {"metadata": {"labels": {"date": "test"}}}}}' The same command does not work in Windows Powershell Console (ISE). The error is: kubectl : Error from server (BadRequest): invalid character 's' looking for beginning of object key string At line:1 char:1 + kubectl patch deployment wapi-backend-d1 --patch '{"spec": {"template ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (Error from serv...ject key string:String) [],

Copy all script arguments to another variable

隐身守侯 提交于 2019-12-01 11:06:41
I need to copy all script arguments and pass them to another script. I have tried to do it like this: args=$@ printargs.sh $args echo ------ printargs.sh "$args" but in such case if i call my parent script with arguments containing spaces e.g.: script.sh "arg 1" "arg 2" then it prints arg 1 arg 2 ---- arg 1 arg 2 How should I do this in bash or alternatively to be compatible with POSIX? $@ is like an array, so your temporary storage needs to be an array: args=( "$@" ) # quotes are needed there And then to use them: printargs.sh "${args[@]}" 来源: https://stackoverflow.com/questions/29536328/copy

Passing request scoped variable passed as EL action method parameter does not work

冷暖自知 提交于 2019-12-01 11:06:10
I am using JSF 2.2 on Glassfish 4.1. I am trying to pass in a query parameter to as an action method argument as follows: // Example 1. This does not work. // at url http://localhost:8080/app/order.xhtml?email=test@email.com <p:commandButton value="Place order" action="#{orderManager.placeOrder(param['email'])}" /> (Know that param is an implicit EL object .) In the server log I have configured it to print the method parameter, but I can see that an empty string was passed-in, not "test@email.com" as I expected. I have confirmed that my overall configuration is working. If I replace the above

Fragment (anchor #) in .NET 4 WebBrowser Control getting lost with Adobe PDF Reader and file://

蓝咒 提交于 2019-12-01 10:45:50
I create an URI with a fragment (aka anchor #). UriBuilder ub = new UriBuilder("file://path/doc.pdf"); ub.Fragment = "chapterX"; The url is shown correctly in the debugger (ub -> file://path/doc.pdf#chapterX ). But when I assign it to a WebBrowser control, the fragment part gets lost (reason for the fragment see PDF Open parameter ). this._myWebBrowser.Url = ub.Uri; // Alternative this._myWebBrowser.Navigate("file://path/doc.pdf#chapterX"); When I check this._myWebBrowser.Url it displays file://path/doc.pdf . this._myWebBrowser.Url.Fragment is empty - also readonly and cannot be assigned. As C

Pass parameter to all views

一个人想着一个人 提交于 2019-12-01 08:34:13
I want to display the username/last connection date/time and some other info on all of my Twig views (which all extend from a common Twig layout). How can I achieve that without having to explicitly pass those parameters from each controller to each view? Do I have to create a Twig extension, or make a call to a controller/action that will retrieve username/connection/other info from the layout using render ? I'd like a simpler solution if possible. User is accessible as a predefined global variable, take a look at this , and if you want to reuse the same template fragment in all your

Copy all script arguments to another variable

跟風遠走 提交于 2019-12-01 07:28:05
问题 I need to copy all script arguments and pass them to another script. I have tried to do it like this: args=$@ printargs.sh $args echo ------ printargs.sh "$args" but in such case if i call my parent script with arguments containing spaces e.g.: script.sh "arg 1" "arg 2" then it prints arg 1 arg 2 ---- arg 1 arg 2 How should I do this in bash or alternatively to be compatible with POSIX? 回答1: $@ is like an array, so your temporary storage needs to be an array: args=( "$@" ) # quotes are needed

How to use HTML forms without a server

Deadly 提交于 2019-12-01 06:54:50
问题 I am not a web-developer and want to understand the better way to pass variables. In the past I have used various ways to pass things to java script functions. I have never used forms as I always associated them with server and databases. I have a website in which user selections change the contents of the website. I am wondering if you can use forms without any server just as a way to pass a few things to a javascript function where they are used to change the page content. For basic example