A
Andrew Purser
Hello,
I am working with JSP Custom tags.
I am hoping that my question has a relativly simple answer and I
suspect it has been asked here before but I haven't been able to find
it by searching the archive.
I have a com.xxx.Connection object which I need to reference in my JSP
tag.
Hence I have
private com.xxx.Connection myConnection;
public void setMyConnection(com.xxx.Connection conn)
{
myConnection = conn;
}
public com.xxx.Connection getMyConnection()
{
return myConnection;
}
The problem I have is with the Setter. It needs to refer to an
instance of com.xxx.Connection which has previously been setup. The
problem is myConnection is passed as a String by the tag, and I need
to use that String to reference the instance of com.xxx.Connection
which has already been setup.
=====Sample JSP=======
<myTags:makeConnection callIt="connectionToUse" />
<myTags:useConnection myConnection="connectionToUse" />
=====Sample End========
To cut to the chase I need a setter which looks like the following
public void setMyConnection(String myConnection)
{
com.xxx.Connection connection
= referenceTheInstanceOfConnectionWhichAlreadyExistsWithTheName(myConnection)
}
Firstly, does anyone out there understand what I am on about?
Secondly does anyone have a solution?
Your thoughts are much appreciated.
Cheers,
Andrew.
I am working with JSP Custom tags.
I am hoping that my question has a relativly simple answer and I
suspect it has been asked here before but I haven't been able to find
it by searching the archive.
I have a com.xxx.Connection object which I need to reference in my JSP
tag.
Hence I have
private com.xxx.Connection myConnection;
public void setMyConnection(com.xxx.Connection conn)
{
myConnection = conn;
}
public com.xxx.Connection getMyConnection()
{
return myConnection;
}
The problem I have is with the Setter. It needs to refer to an
instance of com.xxx.Connection which has previously been setup. The
problem is myConnection is passed as a String by the tag, and I need
to use that String to reference the instance of com.xxx.Connection
which has already been setup.
=====Sample JSP=======
<myTags:makeConnection callIt="connectionToUse" />
<myTags:useConnection myConnection="connectionToUse" />
=====Sample End========
To cut to the chase I need a setter which looks like the following
public void setMyConnection(String myConnection)
{
com.xxx.Connection connection
= referenceTheInstanceOfConnectionWhichAlreadyExistsWithTheName(myConnection)
}
Firstly, does anyone out there understand what I am on about?
Secondly does anyone have a solution?
Your thoughts are much appreciated.
Cheers,
Andrew.