Call core function/constructor by its String name
Hi,
I worked out a way to call a function whose name is in a String variable. That is:
function myFunction()
trace("Hello!");
var callFunction:String = "myFunction";
this[callFunction](); // "Hello!"
However, this does not work with "core" fnctions and constructors, for example new constructor.
So is it possible to, for example, create a variable of a type given in another String variable?
I mean sth like the following:
var varType:String = "Array";
var arrayVar:* = this["new " + varType](); // being equal to calling new Array();
Thank you in advance for any help
Something like this:
var clazz:Class = flash.utils.getDefinitionByName("Array") as Class;
var myArr:* = new clazz();
myArr.push("hello world","I'm an array");
trace(myArr.join("||||"))
Note that Array is a Top Level Class. So for Sprite (or other classes inside packages) you need to use "flash.display.Sprite" as the fully qualified Class name.
See: http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/utils/package.html#getDefinitionByName()
Similar Messages
-
How to call a stored procedure using its package name in Oracle
hi
we're doing a JDBC scenario where we call a stored procedure(a.prc) using its package name(b)The stored procedure has In /Out/IN-OUT parameter.
i have got 2 queries:
1- How to call the stored procedure using it's package.
2- How to capture the In/Out parameter in the response.hi Prateek
thanks for the reply.
However when i tried mapping it to Package.procedure, communication channel throws the error saying that Package.proceudre needs to be declared.
As i said , the procedure has IN-OUT parameter too.In oracle we need to write a block if we want to read the IN-OUT parameter.
How to get the IN-OUT parameter in XI? -
Calling c function that return a string
Hallo,
I found an example for calling void c function(http://zone.ni.com/devzone/cda/epd/p/id/1513). I could adapt the example and make the function return an integer. the code of the adapted function would look like this:
int __declspec(dllexport) multiply(int number) {return number*3; }
But I have problems when I want to return a string. Does someone knows how I should do. I tried:
char* __declspec(dllexport) say(int number) {return "hallo"; }
but won't compile.yes the question was more a c question then a labview question. I found the solution anyway, the correct code in order to get string is:
_declspec(dllexport) char* testchar2();_declspec(dllexport) char* testchar2() { return "hallo"; } -
Calling Java Function with Return as String []
Hi,
I have written the following code. It's not compiling OK.
DECLARE
TYPE Tokens_Type IS VARYING ARRAY(20) OF VARCHAR2(20);
s1 Tokens_Type DEFAULT NULL;
SQL_STR VARCHAR2(2000) DEFAULT NULL;
BEGIN
SQL_STR := 'CREATE OR REPLACE FUNCTION Schema1.SPLIT_STR (S2 VARCHAR2(20)) ' ||
'RETURN s1 ' ||
'AS LANGUAGE JAVA ' ||
'NAME ''String_Mani.split_it (String) return java.lang.String []''';
EXECUTE IMMEDIATE SQL_STR;
END;
What's the problem with this?Hi,
I have written the following code. It's not compiling OK.
DECLARE
TYPE Tokens_Type IS VARYING ARRAY(20) OF VARCHAR2(20);
s1 Tokens_Type DEFAULT NULL;
SQL_STR VARCHAR2(2000) DEFAULT NULL;
BEGIN
SQL_STR := 'CREATE OR REPLACE FUNCTION Schema1.SPLIT_STR (S2 VARCHAR2(20)) ' ||
'RETURN s1 ' ||
'AS LANGUAGE JAVA ' ||
'NAME ''String_Mani.split_it (String) return java.lang.String []''';
EXECUTE IMMEDIATE SQL_STR;
END;
What's the problem with this? -
How to call a function from Java to JSP
Hello,
I have a question about using tags.
I have a java file,which has a function. Now I want to call this function into my JSP page.
I'm using JSP 1.2 and TOMCAT 4.1 with Java2 SDK.
I search through the web and find a method to do this.Bu it requires JSP 2.0
But I try that in my machine(using JSP 1.2).It gives an error:
Did you know what is the error? Or is there any method to call a function into my JSP page?
Please, help me to solve this.
Here are my codes(part of them)
UserPassword.java file
package data;
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class UserPassword
public static String verify(String username,String password){
// some codes
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/j2ee/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>simple</short-name>
<uri>http://jakarta.apache.org/tomcat/HRM/WEB-INF/lib</uri>
<description>
A tab library for the login
</description>
<function>
<description>verify username and password</description>
<name>verify</name>
<function-class>data.UserPassword</function-class>
<function-signature>String verify(java.lang.String,java.lang.String)
</function-signature>
</function>
</taglib>I put this file into the webapps/HRM/WEB-INF/lib folder
Here is my JSP file.
<%@ page language="java" %>
<%@ page import="data.UserPassword" %>
<%@ page session="true" %>
<%@ taglib prefix="login" uri="/WEB-INF/lib/LoginVerify.tld" %>
<jsp:useBean id="useraccount" class="data.UserPassword"/>
<jsp:setProperty name="useraccount" property="*"/>
<%
String status = UserPassword.verify(String username,String password);
String nextPage = "MainForm.jsp";
if(status.equals("InvalidU")) nextPage ="InvalidUserName.jsp";
if(status.equals("InvalidP")) nextPage ="InvalidPassword.jsp";
if(status.equals("main")) nextPage ="MainForm.jsp";
%>
<jsp:forward page="<%=nextPage%>"/>
Here is the error:
org.apache.jasper.JasperException: XML parsing error on file /WEB-INF/lib/LoginVerify.tld: (line 18, col -1): Element "taglib" does not allow "function" here.
at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:189)
at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:247)
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:183)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:354)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:381)Please, help me to solve this trouble.
Thanks.Yes. As serlank showed, you can just call the function easily in scriptlet tags
However the whole point of a tag library is to avoid the use of scriptlets.
Seeing as you can't use functions, is just to do it as a standard tag.
ie in your jsp
<login:verify name="<%= userName %>" password = "<%= password %>" resultVar = "status"/>
<c:choose>
<c:when test="${status == 'InvalidU'}">
<c:set var="nextPage" value="InvalidUserName.jsp"/>
</c:when>
<c:when test="${status == 'InvalidP'}">
<c:set var="nextPage" value="InvalidPassword.jsp"/>
</c:when>
</c:choose>In your case, this tag in the tld would possibly look something like this.
You would then have to write a tag handler class that would call the function you want.
<tag>
<name>verify</name>
<tagclass>com.tags.login.Verify</tagclass>
<teiclass>com.tags.login.VerifyTEI</teiclass> (if required)
<bodycontent>JSP</bodycontent>
// name attribute
<attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
// password attribute
<attribute>
<name>password</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
// result variable to return a response from the tag.
<variable>
<name-from-attribute >resultVar</name-from-attribute >
<variable-class>java.lang.String</variable-class>
<declare>true</declare>
<scope>AT_END</scope>
</variable>
</tag>Hope this helps some, and doesn't confuse too much :-)
Cheers,
evnafets -
Cannot call AS3 Function from JavaScript
Hi,
I am trying to call an ActionScript 3 function with JavaScript. The problem I cannot seem to get any of the browsers to trigger this AS3 function. The debuggers say that the function is undefined when I call it on the flash object.
What is supposed to happen is - the javascript function calls the AS3 function, and passes it an integer value. That integer is then used to pull one of 20 swfs, and load that into the flash movie.
Please let me know if you guys can think of anything that I can do to make this work! I've been stuck for hours, and can't seem to make it happen.
Here is my actionScript:
import flash.net.URLRequest;
import flash.display.Loader;
import flash.external.ExternalInterface;
var movies:Array = ["idle-ok.swf", "idle-good.swf"];
// It first loads this "hello swf".
var helloLoader:Loader = new Loader();
var helloURL:URLRequest = new URLRequest("idleAvatar.swf");
helloLoader.load(helloURL);
addChild(helloLoader);
var setAvatar:Function = loadAvatar;
ExternalInterface.addCallback("callSetAvatar", setAvatar);
// Then, this function should be called by JavaScript to load one of the other swfs.
function loadAvatar(indx:Number){
var url:URLRequest = new URLRequest(movies[0]);
var ldr:Loader = new Loader();
ldr.load(url);
addChild(ldr);
Here is my JavaScript:
<script type="text/javascript">
function callExternalInterface(val) {
document.getElementById("loader").callSetValue(val);
</script>
Here is my embed code:
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="250" height="350" id="loader" name="loader">
<param name="movie" value="loader.swf" />
<param name="allowscriptaccess" value="always" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="loader.swf" width="250" height="350">
<param name="allowscriptaccess" value="always" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
<a href="#" onClick="callExternalInterface(1)">CLICK</a>You don't appear to be calling any function in your actionscript. The names between and within do not agree.
document.getElementById("loader").callSetValue(val);
should be calling a function identified with the string "callSetValue" in your actionscript, but you only have a function identified with "callSetAvatar" and the function associated with that on your AS3 side is specified to be setAvatar...
ExternalInterface.addCallback("callSetAvatar", setAvatar);
but you do not have a function named setAvatar, you have one named loadAvatar
Here's a link to a tutorial that might help you to see how the functions are specified between javascript and actionscript using the ExternalInterface class. It gets confusing so I suggest you copy the code to a word processing file so you can clearly highlight where they have the same language between them.
http://viget.com/inspire/bi-directional-actionscript-javascript-communication -
Unable to set breakpoint at statement CALL CUSTOMER-FUNCTION
HI,
I am try to set break point at CALL CUSTOMER-FUNCTION , to know the exit name for VA01 screen.
But even after setting the break point it is not stopping . can anyone tell me wht could be the problem.
i am setting like this ,
1) entering '/h'
2) from menu BREAKPOINTS->BREAKPOINT AT -> STATMENT
3) Enter.
4)f8
mineis Ecc 5.0 version.
please let me knowHi,
Here is the final answer to your problem.
CALL CUSTOMER-FUNCTION does NOT call the function module if it is not linked to an active project. Thus, a break-point in the function module will be ineffective.
So make sure you have linked it to a project.
Also refer this nice link on wiki for User Exits.
[Customer Exits (CMOD)|http://wiki.sdn.sap.com/wiki/display/ABAP/CustomerExits%28CMOD%29]
Hope this solves your problem, close the thread if it does solve.
Regards
Abhii
Edited by: Abhii on Aug 27, 2010 8:47 PM -
Call a function, which name is in an Array of Strings...
hey all
i have a simple Temp class (made to check things) in a file called Temp.java with the following definition :
public class Temp {
int data1;
int data2;
public Temp (){
data1=0;
data2=0;
(here i have get and set functions for both data1 and data 2, and i have the two following functions)
public void printAdd(){
System.out.println("Result : "+(data1+data2));
public void printSubtract(){
System.out.println("Result : "+(data1-data2));
}i have another class called Server who has the following simple code :
public class Server {
public static void main( String args[] )
String[] table={"printAdd","printSubtract"};
Temp game=new Temp();
game.setdata1(8);
game.setdata2(4);
//the following two calls work perfectly
game.printAdd();
game.printSubtract();
System.out.println(table[0]);
//but the following does not...
game.(table[0]);
}as probably you have understood i am trying to call a function to the object game which name is in the String table... how can i actually made a call game.(THE_VALUE_OF_STRING_IN_AN_ARRAY) ...?i want to call the function printAdd() to the game object..
but i want the program to find out the name of the function to call.. i want to execute the function whose name is at the array in position 0 -> table[0]
so i want the program to resolve the table[0] to printAdd and the use it and call it on object game... -
Call a function by String name
In JavaFX, how can one call a function based on it's String name?
For example, if I had a sequence like ["one","two","three"] how could I call functions one(), two(), and three() by referencing the sequence?
In other words, what is a better way to do:
if (sequence[x] == "one")
one();
if (sequence[x] == "two")
two();
if (sequence[x] == "three")
three();Thanks in advance.Here is a plain old JavaFX class (a pofxo?) with three methods one, two and three.
package reflectionexample;
public class FunctionInvocationExample {
public function one() {
println("One");
public function two(message : String) {
println("Two - {message}");
public function three() {
println("Three");
}So this class has no knowledge of anything to do with reflection, it will be what we will invoke with the code below...
(place this in some other class file - or a function that gets invoked somehow)
package reflectionexample;
import java.lang.Class;
import javafx.reflect.FXLocal;
import javafx.reflect.FXType;
import javafx.reflect.FXValue;
// create the example object
var example = FunctionInvocationExample{}
var exampleObjectValue = FXLocal.getContext().mirrorOf(example);
var exampleClassType = exampleObjectValue.getClassType();
var argumentTypesForOne : FXType[];
var functionOne = exampleClassType.getFunction("one", argumentTypesForOne);
var argumentValuesForOne : FXValue[];
// Invoke function "one"
functionOne.invoke(exampleObjectValue, argumentValuesForOne);
// To invoke function "two" we need more stuff around the argument types and values
var stringClass = Class.forName("java.lang.String");
var stringType = FXLocal.getContext().makeTypeRef(stringClass);
var argumentTypesForTwo = {stringType};
var functionTwo = exampleClassType.getFunction("two", argumentTypesForTwo);
var message = "Hello World";
var messageValue = FXLocal.getContext().mirrorOf(message, stringType);
var argumentValuesForTwo = {messageValue};
// Invoke function "two"
functionTwo.invoke(exampleObjectValue, argumentValuesForTwo);Which when you run it will produce the following...
standard-run:
One
Two - Hello World -
Can an actionListener function be called inside a constructor?
Can an actionListener function be called inside a constructor??
class MainBean{
public MainBean(){
Can the linkDescription() function be called here?? Will there be any Parameters.??
public void linkDescription(ActionEvent e )
// actionListener Code
}vishnuS1984 wrote:
@kevinaworkman : I am still struggling to assess how to :) what will be the syntax to call a function which takes in pameters like 'linkDescription (ActionEvent evt)'. I have not tried out yet...but can i call it by ' linkDescription() ' from inside my constructor.Its a basic java doubt as to how to call a function which accepts object of ActionEvent as parameters.I am still a begginer in Java who is trying to code in Spring:).Well, do you actually use the parameter in the method? This is completely legal:
public class NullTest {
public NullTest() {
doMyMethod(null);
public void doMyMethod(String parameter){
System.out.println("I don't care about my parameter!");
public static void main(String[] args) {
new NullTest();
} -
Call a function with variable function name
Hey guys,
I have a func_table which maintains function names (each one makes reference to a dynamically generated stored function)
I need to make a procedure that calls the functions in that table one by one using its name retrieved from SELECT func_name FROM func_table;
Thanks929955 wrote:
I have a func_table which maintains function names (each one makes reference to a dynamically generated stored function)
I need to make a procedure that calls the functions in that table one by one using its name retrieved from SELECT func_name FROM func_table;Okay, first the bit where I, foaming at mouth and vigorously waving a well used lead pipe around, tell you that this is HIGHLY SUSPECT and likely a FLAWED DESIGN. That dynamic code is 99% of the time wrong. That dynamic code opens securities hole for code injection. That dynamic code often results in severe performance penalties as the coder is clueless about what the Oracle Shared Pool is about. And so on...
As for a basic procedure template to do this - assuming all functions get the same parameter as input and that all functions returns the same data type:
create or replace procedure FooBarFunctions( paramVal number ) is
.. variables and types and cursor definitions..
begin
for c in (
select function_name from my_fubar_functions order by function_order
) loop
plsqlBlock := 'begin :result := '||c.function_name||'( param => :p ); end;';
execute immediate plsqlBlock using out funcResult, in paramVal;
.. do something with funcResult ..
end loop;
.. more code..
end;
{code}
Looks not like a sensible approach though - and begs for justification as to why this approach is needed. What justification do you have? -
Calling a function from string
I have a little class that is used to call a function at a certain interval in ms and one of my parameters for the method is the name of the function to be called.
However I'm not sure how to implement this as i come from a Flash/Actionscript background which is almost the same as java but with a slightly different API.
In Actionscript I would do something like this>
function pause(class:Object,Fname:String, interval:Number):Void {
//do the waiting then>
class.eval(Fname).call();
Keep in mind that this function could belong to any class but I pass a reference to the class as one of the function parameters.
BTW is there anyway to pass not only a reference to an object but also to a function at the same time?
eg. function pause(this.functionname():Method, interval:Number):Void {
If I had a reference to the method then I would not need to look at a string to find out what function to call.
cheers
Message was edited by:
UndernetJava is a compiled language, which means that stuff like eval() isn't available.
You could use reflection to get a method from a string. But a better option might be the Command pattern. In this an object represents a command to be run, and you can pass multiiple such objects around in various circumstances. For example, the Runnable interface indicates that an object that implements it has a method that can be invoked to run a particular command. I may not be explaining this well.
So what you could do is, you could pass a Command object that itself may be just a wrapper around the object and method that you want to run.
Look at java.util.Timer and java.util.TimerTask for example. -
Why constructor's name is same as its class name?
I would like to know why constructor's name is same as its class name.
Any idea...It's because by means of the constructor, you can "construct" objects of the
same class (by "same class" read "same properties") with values that will
accomodate your needs for the work needed to be done.
For example:
MyColor redColor = new MyColor("RED");
MyColor greenColor = new MyColor("GREEN");
MyColor pinkColor = new MyColor("PINK");The class "MyColor" is unique in the JVM. However it has 3 instances, created by its constructor which, minimally, would look like:
class MyColor{
String theColor = null;
//Constructor
public MyColor(String whichColor){
theColor = whichColor;
}With such a constructor, you're telling the JVM:
"Load the class MyColor and create an instance of it with the given values for its properties". -
How to get a called procedure/function name within package?
Hi folks,
is it possible to obtain a called procedure/function name within package?
For a measuring and tracing purpose, I would like to store an info at the beginning of each procedure/function in package with timestamp + additional details if needed.
For example:
CREATE OR REPLACE PACKAGE BODY "TEST_PACKAGE" IS
PROCEDURE proc_1 IS
BEGIN
api_log.trace_data(sysdate, 'START.' || ???????);
api_log.trace_data(sysdate, 'END.' || ???????);
END;
PROCEDURE proc_2 IS
BEGIN
api_log.trace_data(sysdate, 'START.' || ???????);
proc_1;
api_log.trace_data(sysdate, 'END.' || ???????);
END;
END; I would like to replace "???????" with a function which would return a name of called procedure, so result of trace data after calling TEST_PACKAGE.proc_2 would be:
11.1.2013 09:00:01 START.*TEST_PACKAGE.proc_2*
11.1.2013 09:00:01 START.*TEST_PACKAGE.proc_1*
11.1.2013 09:00:01 END.*TEST_PACKAGE.proc_1*
11.1.2013 09:00:01 END.*TEST_PACKAGE.proc_2*I tried to use "dbms_utility.format_call_stack" but it did not return the name of procedure/function.
Many thanks,
Tomas
PS: I don't want to use an hardcodingYou've posted enough to know that you need to provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
>
is it possible to obtain a called procedure/function name within package?
For a measuring and tracing purpose, I would like to store an info at the beginning of each procedure/function in package with timestamp + additional details if needed.
>
I usually use this method
1. Create a SQL type for logging information
2. Put the package name into a constant in the package spec
3. Add a line to each procedure/function for the name.
Sample package spec
* Constants and package variables
gc_pk_name CONSTANT VARCHAR2(30) := 'PK_TEST';Sample procedure code in package
PROCEDURE P_TEST_INIT
IS
c_proc_name CONSTANT VARCHAR2(80) := 'P_TEST_INIT';
v_log_info TYPE_LOG_INFO := TYPE_LOG_INFO(gc_pk_name, c_proc_name); -- create the log type instance
BEGIN
NULL; -- code goes here
EXCEPTION
WHEN ??? THEN
v_log_info.log_code := SQLCODE; -- add info to the log type
v_log_info.log_message := SQLERRM;
v_log_info.log_time := SYSDATE;
pk_log.p_log_error(v_log_info);
raise;
END P_PK_TEST_INIT;Sample SQL type
DROP TYPE TYPE_LOG_INFO;
CREATE OR REPLACE TYPE TYPE_LOG_INFO AUTHID DEFINER AS OBJECT (
* NAME: TYPE_LOG_INFO
* PURPOSE: Holds info used by PK_LOG package to log errors.
* Using a TYPE instance keeps the procedures and functions
* independent of the logging mechanism.
* If new logging features are needed a SUB TYPE can be derived
* from this base type to add the new functionality without
* breaking any existing code.
* REVISIONS:
* Ver Date Author Description
* 1.00 mm/dd/yyyy me Initial Version.
PACKAGE_NAME VARCHAR2(80),
PROC_NAME VARCHAR2(80),
STEP_NUMBER NUMBER,
LOG_LEVEL VARCHAR2(10),
LOG_CODE NUMBER,
LOG_MESSAGE VARCHAR2(1024),
LOG_TIME TIMESTAMP,
CONSTRUCTOR FUNCTION type_log_info (p_package_name IN VARCHAR2 DEFAULT 'Uninitialized',
p_proc_name IN VARCHAR2 DEFAULT 'Uninitialized',
p_step_number IN NUMBER DEFAULT 1,
p_LOG_level IN VARCHAR2 DEFAULT 'Uninit',
p_LOG_code IN NUMBER DEFAULT -1,
p_LOG_message IN VARCHAR2 DEFAULT 'Uninitialized',
p_LOG_time IN DATE DEFAULT SYSDATE)
RETURN SELF AS RESULT
) NOT FINAL;
DROP TYPE BODY TYPE_LOG_INFO;
CREATE OR REPLACE TYPE BODY TYPE_LOG_INFO IS
CONSTRUCTOR FUNCTION type_log_info (p_package_name IN VARCHAR2 DEFAULT 'Uninitialized',
p_proc_name IN VARCHAR2 DEFAULT 'Uninitialized',
p_step_number IN NUMBER DEFAULT 1,
p_LOG_level IN VARCHAR2 DEFAULT 'Uninit',
p_LOG_code IN NUMBER DEFAULT -1,
p_LOG_message IN VARCHAR2 DEFAULT 'Uninitialized',
p_LOG_time IN DATE DEFAULT SYSDATE)
RETURN SELF AS RESULT IS
BEGIN
self.package_name := p_package_name;
self.proc_name := p_proc_name;
self.step_number := p_step_number;
self.LOG_level := p_LOG_level;
self.LOG_code := p_LOG_code;
self.LOG_message := p_LOG_message;
self.LOG_time := p_LOG_time;
RETURN;
END;
END;
SHO ERREdited by: rp0428 on Jan 11, 2013 10:35 AM after 1st cup of coffee ;) -
How to call methods from string names?
On my java project i have a front controller. All the requests will first go to controller and i will make parameter validation on the controller level. If validation is completely ok, page will be dispatched to real servlet with validated parameters.
If the request pattern is "photos" for example i will call static function and send referance of request object Validation.Photos(request); or if the pattern is "albums" function will be Validation.Albums(request).
everything is ready on my codes except how to call a Validation function with a string name. Need a clear and a fast way because on every request i will do this.
Thank youahh life is problem;) another one i couldnt understand.
import javax.servlet.http.HttpServletRequest;
interface Validasyon {
boolean invoke(HttpServletRequest request,String param);
class IntIsNumeric implements Validasyon {
public boolean invoke(HttpServletRequest request,String param) {
param=request.getParameter(param);
System.out.println("param="+param);
try
Integer.parseInt(param);
catch(NumberFormatException e)
return false;
catch(NullPointerException e)
return false;
int gelen1=Integer.parseInt(param);
if(gelen1<1 || gelen1>Integer.MAX_VALUE)
return false;
return true;
}i am sending parameter to IntIsNumeric classes's invoke method like below
Validasyon c=new IntIsNumeric();
boolean a=c.invoke(request,"photo_id");but IntIsNumeric method does not recognize my input parameters "request" and "param" always return null. Why?
Maybe you are looking for
-
Data not available in RZ20 under availability
Hi Friends, In RZ20 under availability monitor the system is not getting the data whether it is available or not. the CCMSPING agent is running fine and have restarted the CCMSPING agent and also reset the local segment to warmup. but still the data
-
Need to send a mail when job window time is over
Hi , select * from v$version; Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production PL/SQL Release 11.2.0.2.0 - Production CORE 11.2.0.2.0 Production TNS for Linux: Version 11.2.0.2.0 - Production NLSRTL Version 11.2.0.2.0 - Pr
-
Hi All, How to insert data into table and store it with out backend access. Please help me out with any sample documents. Thanking you, jyothi.
-
iCal noob here. I just published a calendar to mobileme with all the options checked and when i go to the url there is no data in the calendar. What am I missing? Also, is Exporting an ics. to my mobileme disk as a backup sufficient for backing up th
-
Hi everyone, So, all of a sudden I'm having aliasing issue with my smart objects in CS6 I never had before. I've searched all over PS and these forums to try and figure out how to get rid of the jaggies, with no luck. Below is a screenshot example of