HOW TO GIVE CLASS NAME DYNAMICALLY???
Hi all!
I want to give class name dynamically to my statment
<jsp:useBean id="myBean" scope="session" class="myPackage.myClass"/>
now here i want to pass a String as class name how can i do it?
Jiaa:):):)
Hi,
You can't assign dynamically a classname in the instruction jsp:useBean
S�b
Similar Messages
-
How to generate file name dynamically in receiver FIle adapter? Please help
Dear Experts,
I have a scenario where I need to generate output file with the name dynamically pulled from the XI payload.
In receiver File communication channel I don't see any option where we can specify the XML path for the file name.
For example:
If my inbound XML structure (inbound interface) is like below:
<filename>file123.txt</filename>
<RootNode>
<Element1>Product123</Element1>
<RootNode>
From this I need to pick the filename value and generate the output file with the same value.
How can I achieve this? Please help!
Thanks & Regards
Gopal
Edited by: gopalkrishna baliga on May 3, 2011 1:10 PMGopal,
You can use DynamicConfiguration class for this.
You need to write UDF for this and with input of filename you want to set and map this UDF to the top level node.
Refer the below famous blog from Micheal:
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
You can also use Variable substitution to get value from payload, search SDN on this.
--Divyesh Vasani -
How to get Class Name given along with java.exe
Hi friends,
I am Mukesh, currently facing one problem
On command prompt to execute any java program we give :
C : \.-- > java ClassName
This ClassName I need in my application, I want to do some post processing on that.
Actually see what I want :
public class Base
static Base object;
public static void main(String[] args) throws Exception
object=(Base)Class.forName("Derived Class Name").newInstance();
void main()
public class Derived extends Base
void main()
System.out.println("Hello World");
I am trying to Run Derived Class, since there is no entry point found, default JVM invoke the Base class's entry point, there I want to load
Derived Class, but I am not getting any identity of derived class in Base class.
I found one temporary solution to this problem :
C: \ -- >java Derived Derived
& in Base class, I have loaded class
object=Class.forName(args[0]).newInstance();
But I dont want to write the same thing twise just to know the Class name which is given along with java.exe.
Is there any way to get the ClassName supplied with java.exe
I have tried a lot, still I am trying !!!
If any one knows the answer, help me.
Regards.
Mukesh.Multiple post. Please continue in other thread
http://forum.java.sun.com/thread.jspa?threadID=5196980&tstart=0 -
How to get class name of a object in run time, from its accessible context.
Hi,
I need to get the class name of a java object in run-time, given the AccessibleContext of that object.
I gone through the AccessibleContext api documentation. but there is not way to get the class name for a java object using its AccessibleContext object.
Do any one have any idea how to get the class name of an java object, given its accessible object Accessible.
Thanks
Timberlake816311 wrote:
Please try to provide a solution for my requirement and avoid evaluating a requirement.
I am a curious guyit's great to be curious. however, in this situation, the requirement makes no sense in the given context. so, in an effort to be helpful, the people on this forum are asking you the reason behind the requirement. the reason we do this is because we have experience answering questions on this forum and, more often than not, requirements which don't make sense are the result of misunderstandings or confusion on the part of the person making the requirement. if we can figure out why you want to do what you want to do, we may be able to point you in a direction which makes more sense. -
How to use table name dynamically in report procedure
Hello every body
I want to use table name dynamically means at runtime i want to pass table name.
I can do this by lexical parameter in main query.
But my problem is that i want to crate new format trigger or new function that use 1 cursor in which that lexical parameter : table name is used.
so how to do that?
i can not use that lexical parameter it is giving error.
please help me how to do that.Call a database function which you pass the lexical parameter. Then in the database function you use dynamic sql or the execute immediate option to build the SQL string.
Return the information from this function to build your business logic on in your format trigger.
Marcos -
How to get CLASS name for the generic item?
Hi,
I wrote following method to create a service instance.
public static <IType> IType GetServiceInstance()
IType type=null;
try
InitialContext ic=new InitialContext();
//ERROR: type= ic.lookup(IType.class.getName());
catch(Exception ex)
//do handle
return type;
}please see the //Error: here its giving error, also i m not getting "class" variable in IDE!!!
i want use like this;
IUserService userService=ServiceFactory.GetServiceInstance<IUserService>();so how can i do this?
Edited by: Manikandan.Java on Oct 31, 2007 3:02 AMI don't know if I understand your question, but you cannot find the class name because it is in run time just an object. You can, however, check if it is an instanceof.
if (genericType instanceof MyType) {
doMyThing();
} -
IPhoto - how to give a name to an event?
iphoto - how to give a new name to an event?
You can edit the name in the Info Pane, by clicking on the title under the Event in Events View, by clicking on the Event Title when viewing within an Event and in Photos view, you can edit the Event Titles there too.
-
How to specify class name in environment or system property
Hi,
Iam learning ejb. I was practicing the stateless session bean. I wrote a sample hello world application. While executing the client am getting the following error.
{color:#ff0000}Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at hw.HelloClient.main(HelloClient.java:20){color}
My Client program:
{color:#3366ff}package hw;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.*;
import java.util.*;
public class HelloClient {
public static void main(String[] args)throws Exception {
Properties prop = System.getProperties();
Context ctx= new InitialContext(prop); {color:#800000}// {color}{color:#800000}(Line no :20) here only error is pointing{color}
Object obj = ctx.lookup("HelloHome");
HelloHome home = (HelloHome)javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);
Hello hello = home.create();
System.out.println(hello.hello());
hello.remove();
}{color}
please suggest me a solution.
note: iam using eclipse ganymede and jboss app server
Edited by: Arun_ece on Mar 10, 2009 1:13 AMHi,
You need to create a ejb-jar.xml and jboss.xml files to deploy the application on the servers.
Also, put these lines of codes after getting System Properties.
prop.put(Context.PROVIDER_URL, "iiop://localhost:[port_no]");Thanks,
Srikant -
Hi,
Can you please tell that where we have to give JNDI name for a client,while using EJB.
Thanks.JNDI name is specified in the orion-ejb-jar.xml.
http://download-east.oracle.com/docs/cd/B25221_04/web.1013/b19177/orionejb002.htm -
How to know method name dynamically with sender or EventArgs object
Hello All,
I am working in ASP.NET. I wanna log method name in log file whenever that method is executed. e.g.
protected void Page_Load(object sender, EventArgs e)
Trace.Log("Page_Load start");
Trace.Log("Page_Load end");
protected void Method2(object sender, EventArgs e)
Trace.Log("Method2 start");
Trace.Log("Method2 end");
Trace.Log() is use to log my string in log files at D:\. Now, here I have hard coded Method name in Trace.Log(). But, now I want to fetch method name via c# code. Can we achieve it via sender or EventArgs object?
Please assist.
Thanks, ChintanHello Chintan,
You can get class name through reflection as it gets STATIC info about the component.
However, to get the line number of an exception, which is a run time parameter, you cannot use reflection.
I actually have not tried this before but, given it did not work for you in the web part class, you may try the below code in your *.ascx.cs user control used by your visual web part.
//To Retrieve class name use this line:
string className = this.GetType().FullName;
// To retrieve other parameters including line number
try
TestFunction();
catch (Exception ex)
StackTrace st = new StackTrace(ex, true);
StackFrame[] frames = st.GetFrames();
// Iterate over the frames extracting the information you need
foreach (StackFrame frame in frames)
string stkFrame = string.Format("{0}:{1}({2},{3})", frame.GetFileName(), frame.GetMethod().Name, frame.GetFileLineNumber(), frame.GetFileColumnNumber());
For more info, please refer to this
post.
THosE wHo doN'T apPreCiATe LiFe, DOn't DeSerVe iT -
How to get class name and method name within a class method?
Hi,
In a java class, is it possible to get its class name and the class method?
Please advise.
Thank you.I mean whether there's any built-in command that will
return the class name instead of code it ourself, for
easier maintenance.
Possible?
this.getClass().getName(); -
How to populate table name dynamically to a ref cursor
Hi,
I came accross with a requirement that in ref cursor how can i pass the table name
for ex
open ref_cur for select * from emp;Like that i've some 100 tables , instead of typing each and every time the table name
that should be dynamically changed
Like below
open ref_cur for select * from &tbl_nm;How can i do that??
Thank youI assume you are using SQL*Plus:
SQL> variable ref_cur refcursor;
SQL> begin
2 open :ref_cur for select * from &tbl_nm;
3 end;
4 /
Enter value for tbl_nm: emp
old 2: open :ref_cur for select * from &tbl_nm;
new 2: open :ref_cur for select * from emp;
PL/SQL procedure successfully completed.
SQL> print ref_cur
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 12/17/1980 00:00:00 800 20
7499 ALLEN SALESMAN 7698 02/20/1981 00:00:00 1600 300 30
7521 WARD SALESMAN 7698 02/22/1981 00:00:00 1250 500 30
7566 JONES MANAGER 7839 04/02/1981 00:00:00 2975 20
7654 MARTIN SALESMAN 7698 09/28/1981 00:00:00 1250 1400 30
7698 BLAKE MANAGER 7839 05/01/1981 00:00:00 2850 30
7782 CLARK MANAGER 7839 06/09/1981 00:00:00 2450 10
7788 SCOTT ANALYST 7566 04/19/1987 00:00:00 3000 20
7839 KING PRESIDENT 11/17/1981 00:00:00 5000 10
7844 TURNER SALESMAN 7698 09/08/1981 00:00:00 1500 0 30
7876 ADAMS CLERK 7788 05/23/1987 00:00:00 1100 20
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7900 JAMES CLERK 7698 12/03/1981 00:00:00 950 30
7902 FORD ANALYST 7566 12/03/1981 00:00:00 3000 20
7934 MILLER CLERK 7782 01/23/1982 00:00:00 1300 10
14 rows selected.
SQL> begin
2 open :ref_cur for select * from &tbl_nm;
3 end;
4 /
Enter value for tbl_nm: dept
old 2: open :ref_cur for select * from &tbl_nm;
new 2: open :ref_cur for select * from dept;
PL/SQL procedure successfully completed.
SQL> print ref_cur
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL> SY. -
How to give field name to Receiver File Name.
Hi ,
In my source target structure there is a field name
"job id" .
I need that value coming in that field name to be given to
Receiver File Name.
Thanks in AdvanceHi,
You could use the field name to the File Name. For that you could go ahead with variable substituiton in receiver communication channel.
In receiver Communication channel use variable substitution as
In file name -- %Var1%
In Variable substitution parameter give Var1 ---> payload:<field Name>
Refer
SAP Network Blog: An interesting usage of Variable Substitution in XI
/people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
variable substitution
http://help.sap.com/saphelp_nw2004s/helpdata/en/8e/464442c1a1c253e10000000a1550b0/content.htm
Also see the below links to use the dynamic variable substitution
/people/michal.krawczyk2/blog/2005/03/29/xi-error--unable-to-convert-the-sender-service-to-an-ale-logical-system
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Also
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2
Thanks
swarup -
How to get class names in a package ?
If I know a name of a package , is it possible for me to get all the classes in the package ?
YTes...
u can do so,,in SE80..
Give your package for the Dev Class.
Then check under Class Libraray...
Hope it helps.
Praveen -
How to set queue names dynamically for MQ Adapter - SAP XI
Hi Friends
I have a scenario where I should send a message to multiple queues ( more like broadcasting ) using a single communication channel of MQ Adapter. The scenario is like this
1. If the message content contains value '111' then message should go into Queue A, Queue B, Queue C
2. If the message content contains value '222' then message should go into Queue A, Queue B
I will store the content values inside a table ( value and queue names ) and can pick it up inside BPM but want to know how to change the queue name property of MQ series adapter. I will do this inside a loop so the message can be sent to multiple queue names but want to know how to change the queue name property of receiver communciation channel.
I appreciate the help in providing the answer.
thanks
KannanAmaresh
Thanks for your answer but my question is specifically targeted towards MQ adapter and the queue name which has to be dynamically changed. I can do the dynamic changes for file adapters but want to know how to change the queue names in message mapping or inside BPM.
regards
Kannan
Maybe you are looking for
-
After updating my Itunes software, my Ipod is now not recognised by ITunes! I have been through all the suggestions, but to no avail!!! On top of this I have lost all of my recordings on the Ipod, the only ones left are on the Itunes software on the
-
This is my Biz service Output: <OutputParameters xmlns="http://=XYZ/pcbpel/adapter/db/WT/WT_IN_CS5_PKG/WT_IN_PROM_OSB/" xmlns:xsi="XYZ/XMLSchema-instance"> <P_REC_TYPE> <P_REC_TYPE_ITEM> <ATTRIBUTE_NAME> Free MMS to newly activated subscribers Balanc
-
Problem with import from Onlocation to Premier Pro CS5.5
i noticed that in upgrading from Production premium CS 5 to production premium CS5.5 when one imports a shoot schedule from on-location to premier pro the import to premiere pro no longer convert to the more relevant name created in OL. Ie.
-
Facebook Extremely Slow from Tampa, FL from 6pm-11pm EST
I believe this is a problem with the route because when I use a different connection i get to facebook just fine.. It's super fast on other ISPs and even faster over 3G, than it is on my fios connection.. Here is my trace out to FB during a slow peri
-
Primus line rental with bt total broadband is it p...
I currentley have my line rental and call package billed through BT, and also billed seperatley have the top BT total broadband package, I rarely use the phone and was looking to save money on my line rental. I am more than happy with my broadband a