parameters

Different jsp rendering in Liferay

拥有回忆 提交于 2020-01-17 03:46:26
问题 I need to make following construction: String pageName = request.getParameter("pageName"); if ("some_parameter".equals("pageName")) { include("html/one.jsp", request, response); } if ("third_parameter".equals("pageName")) { include("html/two.jsp", request, response); } But I always have troubles like NullPointerException. I mean I try to make different renderURL show different jsps but I don't know how. If you don't undestand what Im about but have knowledge in this theme please write smth in

Is there a way to pass a set of values as a parameter in an Oracle SQL Statement

筅森魡賤 提交于 2020-01-17 03:41:27
问题 I would like to pass a set of values as a parameter to an Sql Statement (in vb.net). In my case: Users are allowed to upload a set of IDs, to check availability of an item. I would like to execute a statement that will return the items that match any of the IDs by doing something like the following: SELECT * FROM MyTable WHERE id IN ('123','456','789') But I cannot pass on the value ('123','456','789') as a parameter as it will be taken as an atomic value - a whole string, i.e., this will not

How to access URL parameters sent to div via jQuery load()

时光总嘲笑我的痴心妄想 提交于 2020-01-17 02:30:47
问题 I am using jQuery load() to load a partial page into a div. I want to pass url parameters to the partial page like so <div id='partial'></div> <script> $('#partial').load('child_page.html?key=1'); </script> How do I access these parameters from inside the child page? I tried the following in the child page, but the issue is that the window.location is not giving me child_page.html?key=1 but is giving me the root page url. <script> var url = window.location; //code to parse the url to extract

Passing a serverside variable to a javascript function in asp.net

情到浓时终转凉″ 提交于 2020-01-16 19:13:33
问题 I need to pass a server side variable to my javascript function such as below: <asp:HyperLink ID="lnkIDNum" runat="server" NavigateUrl="javascript:ChangeLocView('ChangeView', '<%#Container.DataItem("IDNum")%>')"><%#Container.DataItem("IDNum")%></asp:HyperLink> I get an error at the serverside variable being passed into the Javascript function. Parser Error Message: The server tag is not well formed. Can anyone assist? 回答1: Got it working like this: <asp:HyperLink ID="lnkIDNum" runat="server"

Calling a C# function in asp.net

ⅰ亾dé卋堺 提交于 2020-01-16 17:35:11
问题 I have a WebForm before_adm.aspx.cs which has the code as follows: . . . public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { DropDown abs =new DropDown(); abs.DropDown(); } ..... I want to call a function DropDown() which is in file DropDown.cs The code in DropDown.cs is as follows: using System; using System.Configuration; using System.Data; using System

Parameterized SQL - in / not in with fixed numbers of parameters, for query plan cache optimization?

血红的双手。 提交于 2020-01-16 14:30:44
问题 If SQL is used directly or created by NHibernate, with possibly big "where in / not in ([1 to 100 parameters])" conditions, does it make sense to fill up parameters to certain limits, to have a limited number of query plans? Parameters are int/number, DBMS is MSSQL or Oracle. The queries are called via sp_executesql/executeimmediate to enforce query plan caching. Normally, such a query would have up to 100 query plans for the same query. Several such queries might quickly fill up the cache,

How do you use redirect_to when the action is dependent on a parameter being passed?

橙三吉。 提交于 2020-01-16 04:31:04
问题 How do you use redirect_to when the Edit action is dependent on a parameter being passed? I have two very simple actions edit and update. Once I click submit, following an update I'd like to redirect the user back to the edit action. How do I do this if the edit action requires a parameter? def edit @account = Account.find_by_user_id(@params['user_id']) end def update account = Account.find(params[:account_user_id]) if account.update_attributes(params[:name]) redirect_to params[:user_id]

Is it really impossible to skip template parameters with default arguments in C++, why does syntax suggest otherwise?

南笙酒味 提交于 2020-01-16 04:10:07
问题 I've been trying to find a way to skip a template parameter not located at the end of the template parameter list, in a derived class that has been assigned a default in its base class. I've done some research on this topic, also here on SO. While similar questions have been discussed on SO - many answers basically suggesting it doesn't work were related to very special cases like the hash map case here. Also I found this answer by "Potatoswatter", which in my opinion contradicts the

EvoSuite - Parameters For Getting Most Code Coverage

China☆狼群 提交于 2020-01-16 03:53:09
问题 I'm generating unit tests with EvoSuite and would like to get as close to 100% code coverage from the resulting unit tests as possible. What are the best command line options/parameters to set to accomplish this? 回答1: EvoSuite comes with its parameters already tuned. if you want to improve coverage further, you d need to increase the allotted time for test generation (eg by using -Dsearch_budget parameter), although that cannot guarantee 100% coverage. For more info, see http://www.evosuite

What is the difference between char str[] and char *str as function parameters?

荒凉一梦 提交于 2020-01-16 03:40:07
问题 Say we have the following function prototypes: void function1(char str[]); void function2(char *str); Now say we have a string char name[] = "John"; that we wish to pass through these functions. What is the difference between the two? What are their uses and limitations? Are there circumstances in which one is preferred over the other? Would it make a difference if instead the string were initialized as char *name = "John" ? I understand the difference between using char str[] and char *str