Passing objects from two servlets residing in two servers
Suppose i need to pass an object from one servlet to another servlet ,that are residing in two servers(Tomcat).How can i achieve this.
Plz help me in this regard.
Thanks in Advance......
Serialize them to XML and send as POST parameter
Similar Messages
-
Passing Objects from Servlet to Servlet
Hei,
how do I pass an object from one servlet to another.. or back to the same again?
I have my servlet and there I want
first create an object, then pass that object for processing and manipulating and then pass it for output of the final result..
How can I send and get the object in a servlet?
Big thx,
LoCalHei,
sorry.. maybe I gave to less informations. In fact it's only one servlet...
I can't post the original code but something that makes it clear :)
I wrote the whole project without using Servlet-Technique but normal Java-App. But I designed it so, that I only had to rewrite one class.. and least I thought so.. but now I stuck at this Object-passing problem.
Sorry.. but I'm pretty new to Servlets
Thank you very much in advance for your help.
public class Logger extends HttpServlet {
private Templates templ = new Templates();
private Person pers;
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
String uname = req.getParameter("user");
String pwd = req.getParameter("pwd");
String sts = req.getStatus
PrintWriter out = res.getWriter();
switch(sts) {
case 1: out.println(templ.getXHTMLEditPers(pers));
break;
case 2: out.println(templ.getXHTMLViewPers(pers));
break;
case 3: out.println(templ.getXHTMLView(pers));
break;
default: out.println(tmpl.getXHTMLLogin());
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
doGet(req, res);
} -
Accesing same object from different servlets
Hello all!
I am developing a web control project. I am using a simulator of a factory (with java). The engineers are supposed to be able to change some variables from the web.
I am using servlets to change this variables. My problem is that, to be able to change variables, I need to create an instance of this FactorySimulator object.
If each servlet ( there are many servlets) calls an instance, they will be updating different FactorySimulator objects.
How can I make reference, or have acces to the SAME object, from any servlet?
Thanks! I hope my question is clear =)package com.yourcompany.somepackage;
public class TheFactory
private static FactorySimulator factory = new FactorySimulator();
private TheFactory() {} // Static methods only, do not instantiate TheFactory
public FactorySimulator instance()
return factory;
}From each of your servlets you can call TheFactory.instance().doWhataver(). Methods in FactorySimulator need to be suitably synchronized of course. -
Can we create a BAM data Object from two tables
Hi ,
I want to pull the data from two tables and create a BAM data object, Is it possible in BAM?
Do the needful
Regards,
FrancisThe sample way is using AQ on database. You can create a database view to join the tables. And create AQ on the view, create a ems to listen on the queue.
-
[urgent[ Passing object from server to the midlet
I am building a search function for my mobile application..
I created a servlet "SearchServlet.java" that basically send a query to the dbase to retrieve the values in the database.
In this servlet, I store the results in an arraylist..
The servlet works just fine *I've tested it in the browser and accessed it through the local host"..
The concern now is, what if I need to call the servlet from the midlet application..
How to pass the object from the server to the midlet?
Could someone explain to me the mechanism to pass the object?
What object should be the return value in SearchServlet.java?
Thank you very much..First of all use sober language on forums, its not
your private forum where you can use your abusive
language.And even if it is than its not good manners
to speak in public.Well, quite honestly, my language was not that abusive... I aleady told you that that it's wrong several times... No response on those (at least nothing showing that i would be wrong). And if you keep linking to that code, I find that very anoying.
Second of all. the try catch block sends response
back to J2me app request.Its upto developer whatever
response he wants to send back. There is nothing
wrong in that.No, all it does it declare a string, nothing more, nothing less. No need to catch any exception!
third of all if you think that writeUTF method is
totally wrong, then why dont you show me the
improved solution or correct solution. After all its
forum site, if you know the better solution please
show me rather than always criticising and using
abusive languages.I told you several times that you should read the api docs! It's all in there and you see why you should not read data with readline() when you write that data with writeUTF(). If you fail to do that, and are not capable to learn from that, then that's your own problem. Sure I could show you what it should be (and I beleive I did more than ones), but what does that teach you? Not a lot! Only to keep coming back here and ask more questions that can be found if you take two minutes of time and read docs or search the internet using google or whatever search engine you like (or even the forum search enigne, since that is also rarely used). I'm not talking about you in particular, but about the general level of the questions asked here. 75% of the answers can be found with a little more effort, and in less time than it would take to wait for someone else to come up with an answer.
So please, read what writeUTF() does, and you'll understand what's wrong.
Let me show you:
Writes a string to the underlying output stream using UTF-8 encoding in a machine-independent manner.
First, two bytes are written to the output stream as if by the writeShort method giving the number of bytes to follow. This value is the number of bytes actually written out, not the length of the string. Following the length, each character of the string is output, in sequence, using the UTF-8 encoding for the character. If no exception is thrown, the counter written is incremented by the total number of bytes written to the output stream. This will be at least two plus the length of str, and at most two plus thrice the length of str. What does readline() do? It reads UTF-8 text until some endline character. So it will also read the two length bytes of the wirteUTF method. Is this good? No, it's not. If the lengt is to long, it could even insert extra text characters in the line that should not be there, since readline doesn't know anything about the length bytes, and theats them as normal UTF-8 text.
If you think I dont understand API properly than make
me explain, thats what forums are for...You never said you didn't understand the api docs... I think they are very clear
To end it I really doubt that you are developer/
coder. If you think yourself too perfect please guide
me.I'm not perfect, I'm just putting effort into finding solution myself.
If you are going to continue such an attitude I have
to report to Java forums administrator.I realy don't mind.
Note to original user who posted this message: I am
sorry to write such a comment in your thread, but
"deepspace" user really needs some help.Please, if you want to make a comment, be constuctive. Talking about abusive language... This might be subtle, but it still is abusive! Tell that to all the users I helped already... I bet I'm the most active user here at the moment and I think I helped a whole lot of them very well. Some didn't like my method at first, but in the end, most wil apriciate what I did. I like to let user find out stuff for themselfs, and not give them what they want. They learn much more thay way for sure! -
Error occured when trying to pass object from Jsp to Applet
I am trying to pass a serialized object(ie, object class implements java.io.Serializable...so that is not a problem) from a Jsp to an Applet.
My jsp(Jsp_RMI.jsp) page is:-
<%@ page import="java.io.*" %>
<%@ page import="com.itlinfosys.syslab.mfasys.scm.*" %>
<%@ page import="java.util.*" %>
<applet code="com/itlinfosys/syslab/mfasys/scm/Applet_RMI" width=200 height=100>
</applet>
<%! ObjectOutputStream outputToApplet=null;
PrintWriter out=null;
BufferedReader inTest=null;
%> <% Student student=new Student();
Vector students=new Vector();
students.addElement(student);
outputToApplet=new ObjectOutputStream(response.getOutputStream());
outputToApplet.writeObject(students);
out.println(student);
outputToApplet.flush();
outputToApplet.close();
%> <html> <head> <title>My Page</title> </head> <body> </body> </html>
My Applet Applet_RMI.java is:-
package com.itlinfosys.syslab.mfasys.scm;
import java.applet.*;
import java.net.*;
import java.io.*;
import com.itlinfosys.syslab.mfasys.scm.Student;
import java.util.*;
public class Applet_RMI extends Applet{
Vector aStudent=null;
ObjectInputStream inputFromServlet=null;
String location="<URL>";
public void init(){
getConnection(location);
public void getConnection(String location) {
try{
URL testJsp=new URL(location);
URLConnection jspConnection=testJsp.openConnection();
jspConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
jspConnection.setDoInput(true);
jspConnection.setDoOutput(true);
jspConnection.setUseCaches(false);
jspConnection.setDefaultUseCaches(false);
inputFromServlet=new ObjectInputStream(jspConnection.getInputStream());
aStudent=(Vector)inputFromServlet.readObject();
}catch(MalformedURLException e){ System.out.println(e);
catch(IOException e){
System.out.println(e);
catch(ClassNotFoundException e){ System.out.println(e);
I am using netscape-4.73 on weblogic server. On server when I try to view Jsp page it gives netscape.security.AppletSecurity Exception.
When I am trying to call this Jsp from IE-5 on my client machine, I am getting error:-"java.io.StreamCorruptedException: InputStream does not contain a serialized" Pl help me out.You should probably change your implementation to use a servlet rather than JSP. There may be extra stuff being put in by the JSP. Besides, servlets run faster. Here is some code that may help.
From the Servlet:
public void doPost(
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse )
throws ServletException, IOException {
ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(httpServletRequest.getInputStream()));
requestObject = in.readObject() ;
ObjectOutputStream out = new ObjectOutputStream(new GZIPOutputStream(httpServletResponse.getOutputStream()));
out.writeObject(responseObject);
out.close();
} //end doPost()And from the Applet:
public Object doServletCall(
Object sendObject ) {
try {
HttpURLConnection con = (HttpURLConnection)servlet.openConnection() ;
con.setRequestMethod("POST");
con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);
con.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
ObjectOutputStream out = new ObjectOutputStream(new GZIPOutputStream(con.getOutputStream()));
out.writeObject(sendObject);
out.flush();
out.close();
ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(con.getInputStream()));
Object returnObject = in.readObject() ;
in.close();
return returnObject ;
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} //end try
return null ;
} //end doServletCall()Of course you can remove the ZIP and send object if you don't need them -
Getting data from two servers?
Experts-
We have two servers for storing tables . 1. Historical server 1.Current Prod server
We have same tables in both server databases.
All the info prior to a month of current date is stored in Historical server database tables
and the rest in current prod server dtabase tables.
I have to build reports such that, when user enters a date, OBIEE has to check if the date is in a month period(30 days) of todays date or earlier to 30 days, based on this, it has to get the data from historical server database tables / current prod server database.
How can I implement this?
Do I need to create two connction pools(folders in rpd) and develop same Model twice?(One for historical tables and one for prod tables?)
or Can I use fragmentation technique? if so, Can you give me an Idea hwow to implement Fragmentation for this requirement?
Thanks for your help in advanceYou should use fragmentation for this requirement. It's not that hard once you've understood the basic principle. Read Nico's article here for the detail:
http://gerardnico.com/wiki/dat/obiee/fragmentation_content
The only non-standard bit for you will be to set the fragmentation criteria on your logical table sources. This is the part that tells BI server which source to hit.
Post back here if you get stuck.
Paul -
ClassCastException while passing object from one context to another
I am hoping that someone will bear with me as I think it is my knowledge of classloaders that is tripping me up. I am using Spring and have a SecurityContextImpl object that I want to pass from one web app (WA2) to another web app (WA1). In WA2 I do the following:
ServletContext wa1Context = getServletContext().getContext("WA1");
wa1Context.setAttribute("SPRING_SECURITY_CONTEXT" , SecurityContextImpl);WA1 then tries to get the SPRING_SECURITY_CONTEXT and cast it to a SecurityContext object. This is where I get the ClassCastException. I have:
crossContext="true"in my context.xml fragment. My reading tells me that I may be able to get around this by copying all the spring jars into my Tomcat lib folder but I seem to have to copy so much in there (Spring, hibernate, atomikos etc.) that it does not seem to be a good solution; I gave up before copying all the dependencies it asked for. Is there another way around this problem?
What I really want to do is find an easy way to copy this one object from WA2 into WA1.Thanks for taking the time to test this. I also tried with a String and was successful but still cannot get it to work with my SecurityContextImpl. I also tried passing a String wrapped in a custom bean with a single string property. I get the same ClassCastException. I think that using a String works because it is native to the JVM and somehow bypasses the class loading issue but as I say, my knowledge of classloaders is null.
Here is the exact code I am running in WA1 and WA2:
In WA2 (context is /forum):
ServletContext servletContext = httpRequest.getSession().getServletContext().getContext("/");
servletContext.setAttribute("SPRING_SECURITY_CONTEXT", httpRequest.getSession().getAttribute("SPRING_SECURITY_CONTEXT"));
logger.debug("It was of type [" + httpRequest.getSession().getAttribute("SPRING_SECURITY_CONTEXT").getClass().getName() + "]");In WA1 (A JSP sitemesh decorator with context "/"):
Object object = getServletContext().getAttribute("SPRING_SECURITY_CONTEXT");
System.out.println("IN DECORATOR, OBJECT IS OF TYPE [" + object.getClass().getName() + "]");
SecurityContext securityContext = (SecurityContext) object;The log output is:
DEBUG uk.co.prodia.prosoc.security.spring.cas.login.CheckDecoratorKnowsAboutLogin - It was of type [org.springframework.security.context.SecurityContextImpl]
IN DECORATOR, OBJECT2 IS OF TYPE [org.springframework.security.context.SecurityContextImpl] -
Use HTTP Session to pass Object from Web Dynpro for Java to JSP page
Is it possible to get a handle on the HTTP Session object from within a Web Dynpro application? I want to place a Java object in there that can be retrieved by a JSP page.
Thanks in advance.Hi Tom Cole,
You can try this. i am not sure if this will work or not.
HttpServletRequest request = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
You can also try this.
IWDRequest mm_request = WDProtocolAdapter.getProtocolAdapter().getRequestObject();
HttpServletRequest request = (HttpServletRequest)mm_request.getProtocolRequest();
IWDRequest basically wraps the HttpServletRequest. if you are using NW04s then the getProtocolRequest() may not be available.
Regards,
Sanyev -
How to use common object from two tables with out join.
HI,
I have two tables called A & B In A table i have the following objects
1.weekend
2.S1(measure)
3.S2(measure)
4.S3(measure)
5.S4(measure)
And In B table i have followning columns
1.week end
2.p1(measure)
3.p2(measure)
4.p3(measure)
5.p4(measure)
Now in universe i created all the measure objects i.e.s1,s2,s3,s4,p1,p2,p3,p4 A.weekend,B.weekend.
instead of using week end two times i wnt to use only once because this is common in both table.
if i use join between these tables i am getting values fine
But With out join is there any thing to do in universe level to create common objects to use from both the tables..I tried using aggregate awareness but while reporting it is taking as two SQL.which is not synchronized.
Please help me on this ...hi,
Although Weekend column is present in both tables, by creating a single Object in Universe, Universe can identify relationship with only table referenced in Object Creation.
So, there will be no identification of relationship with other table measures.
Obviously, you need to create 2 Weekend objects in Universe (in two classes).
Case 1: You need not join these two tables in Universe. When you create 2 Queries in WEBI, automatcially Weekend objects are synchronized (if both are of same datatype)
Case 2: If you join these two tables in Universe, Obviously,
your SQL may contain Weekend from Table1, measures from Table 2
or
your SQL may contain Weekend from Table2, measures from Table 1
Finally, You need to create 2 objects in Universe. But your query may contain a single Object based on Case 2.
Regards,
Vamsee -
How to pass Objects from Java App to JavaFX Application
Hello,
New to the JavaFX. I have a Java Swing Application. I am trying to use the TreeViewer in JavaFX since it seems to be a bit better to use and less confusing.
Any help is appreciated.
Thanks
I have my Java app calling my treeviewer JavaFX as
-- Java Application --
public class EPMFrame extends JFrame {
Customer _custObj
private void categoryAction(ActionEvent e) // method called by Toolbar
ocsCategoryViewer ocsFX; //javaFX treeviewer
ocsFX = new ocsCategoryViewer(); // need to pass in the Customer Object to this Not seeing how to do it.
// tried ocsFX = new ocsCategoryViewer(_custObj) ; nothing happened even when set this as a string with a value
public class ocsCategoryViewer extends Application {
String _customer;
@Override
public void start(Stage primaryStage) {
TreeView <String> ocsTree;
TreeItem <String> root , subcat;
TreeItem <String> root = new TreeItem <String> ("/");
root.setExpanded(true);
ocsTree = new TreeView <String> (root);
buildTree(); // this uses the Customer Object.
StackPane stkp_root = new StackPane();
stkp_root.getChildren().add(btn);
stkp_root.getChildren().add(ocsTree);
Scene scene = new Scene(stkp_root, 300, 250);
primaryStage.setTitle("Tree Category Viewer");
primaryStage.setScene(scene);
primaryStage.show();
public static void main(String[] args) {
_customer = args[0]; // temporarily trying to pass in string.
launch(args);JavaFX and Swing integration is documented by Oracle - make sure you understand that before doing further development.
What are you really trying to do? The answer to your question depends on the approach you are taking (which I can't really work out from your question). You will be doing one of:
1. Run your Swing application and your JavaFX application as different processes and communicate between them.
This is the case if you have both a Swing application with a main which you launch (e.g. java MySwingApp) and JavaFX application which extends application which you launch independently (e.g. java MyJavaFXApp).
You will need to do something like open a client/server network socket between the applications and send the data between them.
2. Run a Swing application with embedded JavaFX components.
So you just run java MySwingApp.
You use a JFXPanel, which is "a component to embed JavaFX content into Swing applications."
3. Run a Java application with embedded Swing components.
So you just run java MyJavaFXApp.
You use a SwingNode, which is "used to embed a Swing content into a JavaFX application".
My recommendation is:
a. Don't use approach number one and have separate apps written in Swing and Java - that would be pretty complicated and unwarranted for almost all applications.
b. Don't mix the two toolkits unless you really need to. An example of a real need is that you have a huge swing app based upon the NetBeans platform and you want to embed a couple of JavaFX graphs in there. But if your application is only pretty small (e.g., it took less than a month to write), just choose one toolkit or the other and implement your application entirely in that toolkit. If your entire application is in Swing and you are just using JavaFX because you think its TreeView is easier to program, don't do that; either learn how to use Swing's tree control and use that or rewrite your entire application in JavaFX. Reasons for my suggestion are listed here: JavaFX Tip 9: Do Not Mix Swing / JavaFX
c. If you do need to mix the two toolkits, the answer of which approach to use will be obvious. If you have a huge Swing app and want to embed one or two JavaFX components in it, then use JFXPanel. If you have a huge JavaFX app and want to embed one or two Swing components in it, use a SwingNode. Once you do start mixing the two toolkits be very careful about thread processing, which you are almost certain screw up at least during development, no matter how an experienced a developer you are. Also sharing the data between the Swing and JavaFX components will be trivial as you are now running everything in the same application within the virtual machine and it is all just Java so you can just pass data around as parameters to constructors and method calls, the same way you usually do in a Java program, you can even use static classes and data references to share data but usually a dependency injection framework is better if you are going to do that - personally I'd just stick to simply passing data through method calls. -
Passing objects to a servlet - session or as byte[]
Hi
I'm creating my first servlet and I want opinions on my design. I plan to sue my servlet to generate an image. So in my jsp page I have an image tag with the following
<img src="/Servlet/GenerateImage">But my servlet requires data in an ArrayList from my JSP page. How can I pass the ArrayList to my servlet? I've done some research and been looking aorund the forums, and I noticed people either convert the object to byte[] or pass the object using the session. I've tried doing the byte[] method but I don't know how to pass the byte[] to my servlet. I tried passing it as a parameter using a query string, get the parameter as a string, and convert it to byte[] again, but it didn't work. I can't seem to get this approach to work.
I'm worried that if I use the session, and a large number of people access my page which runs the servlet, my server will be bogged down.
What is the best approach in doing this? It'd be great if some sample code or links are supplied
Thanks for all the help!My servlet requires data in an ArrayList from my
JSP page. How can I pass the ArrayList to my servlet?
I've done some research and been looking aorund the
forums, and I noticed people either convert the object
to byte[] or pass the object using the session. If the ArrayList is derived in the JSP and is required in the servlet, then saving it as a session attribute is the best bet. I guess it would be possible to send all the data from the ArrayList to the client in a cookie, but that seems messy and inefficient.
I'm worried that if I use the session, and a large
number of people access my page which runs the
servlet, my server will be bogged down.The session attribute only contains a reference to the ArrayList and so in itself does not cause a performance problem. If you're concerned that the ArrayList is very large, you could consider saving the info to a disk file. Alternatively, could the ArrayList be derived in the servlet instead of, or as well as, the JSP? Does the servlet need all the Arraylist entries, or just a subset? If a subset, save that as a session attribute and dereference the ArrayList in the JSP. Also, think about when the ArrayList reference can safely be removed from the session.
What is the best approach in doing this? It'd be great
if some sample code or links are suppliedJSP
<jsp:useBean id="myArrayList" class="java.util.ArrayList" scope="session"/>Servlet
HttpSession session = request.getSession();
ArrayList al = (ArrayList) session.getAttribute("myArrayList");
. -
Unable to pass object from pl-sql to wps
Hi Team
I am trying to pass an object to a different system via WPS 6.2. I am using WPS 6.2 and Oracle 10g.
I want to pass an array of objects returned from a Pl Sql procedure as an output to WPS. However, am unable the object values are not being currently received by WPS. WPS calls this procedure (PlSql), which returns an array of objects. However, it reads the object values as '???'. We tried to write them in an XML
<FetchGENEVACustomerOutput>
<ResponseHeader>
<Status>0</Status>
<ErrorMessage>Accounts Details found for Customer with CRN=525Test_SP_TAM</ErrorMessage>
</ResponseHeader>
<GenevaCustomerDetails>
<AccountNumber>???</AccountNumber>
<ProfileID>???</ProfileID>
<BillingCurrency>???</BillingCurrency>
<InfoCurrency>???</InfoCurrency>
<City>???</City>
<State>???</State>
<BillTerm>???</BillTerm>
<PaymentDueDate>???</PaymentDueDate>
I hope I am posting the question in a comprehensive manner. Never worked with WPS before, it is a different team in our organization. Both of us are trying to solve the issue.
Thanks in anticipationMohan,
Have you tried using UTL_SMTP? It uses UTL_TCP and encapsulates a lot of the stuff you're doing manually, so might be easier. Let me know if you need an example.
Hope this helps,
-Dan
http://www.compuware.com/products/devpartner/db/oracle_debug.htm
Debug PL/SQL and Java in the Oracle Database -
Help with passing parameters from a servlet to an applet
dear all
i m working on a application which will check weather a file is present in a server (webserver) if it is present then it will take the file name and put it into a drop down list and there is a button on click of which i m taking the call to an applet and then on that i need the file name if it is there then i use it to draw a graph
i m struck on how to take parameter from Servlet -> Applet
thanks
Nakulhi,
I understood your question,The context "servlet" cannot communicate to
an applet becoz applet runs at clients browswer, rather you can communicate from an applet to servlet(HTTPURLCONNECTION class).
Well coming to the problem, this is how i have understood your problem,
basically uou get the list of files from the server using normal servelt programing and you will display in an html LIst box and then click the button to view the graph or chart ,
then you just want to pass the filename which is there in the listbox to an applet and applet will display some image.
As we know all that using <PARAM NAME=XX VALUE=YY> WE CAN GET THE VALUE IN APPLET BY USING GETPARAMTER() METHOD. and Im very sure that you are not asking that question. your question is like " both the applets and
the listboxes will be loaded at once and when he selects one of the file from the list box then without refreshing the page , how to display the graph.
Im i right?
If so i guess you have to use javascript to do that stuff, and i think its like gave an id for the tag shown <applet id="yes">
then in the javascript , you can call the Java applet methods (I have never tried before but seen some demos(i dont have that links- google it for inf))
but i can give clue like.. trying the <PARAM VALUE=""> IF POSSIBLE
CHAING THE HTML CONTENT IS POSSIBLE IN IE which is again through javascript by calling yes.innerHTML="<PARAM><PARAM><PARAM><PARAM>..."
Im sure that you can call Java methods from javascript but i never tried and even you can pass an arguments to it.. Let me check out like
becoz even im interested to know abt it
bye
with Regars
Lokesh T.C -
Passing data from jsp/servlet to a Tuxedo Service thru VIEW
Hi..
We are using Tuxedo10g R3 on AIX 5.3..
We have a Tuxedo Service running which takes values from the VIEW and converts that to upper case.. From the jsp page v r passing values to the VIEW fields which will be accepted by the service..
For testing v checked the service with a tuxedo client and it is working fine..
We have defined a jolt repository file for this service and finished bulkloading and coded the servlet also.. After passing the datas from the jsp, the Tuxedo service is called and it is ended.. but in the service only blank values are passed or the datas are not passed to VIEW fields.. It is not showing any error..
The repository file for this service:
service=NSIMPSRV
export=true
inbuf=VIEW
inview=sample
outbuf=STRING
param=FIRSTSTR
type=string
access=in
param=SECONDSTR
type=string
access=in
param=THIRDSTR
type=string
access=in
param=S-FIRST
type=string
access=out
param=S-SECOND
type=string
access=out
param=S-THIRD
type=string
access=out
and the servlet code for this service:
Result result1;
ServletSessionPool servletsession = (ServletSessionPool) joltsession.getSessionPool("demojoltpool");
ServletDataSet joltdataset = new ServletDataSet();
joltdataset.setValue("FIRSTSTR","Testing");
joltdataset.setValue("SECONDSTR","Tuxedo");
joltdataset.setValue("THIRDSTR","Views");
result1 = servletsession.call("NSIMPSRV", joltdataset, null);
System.out.println("FIRSTSTR:"+result1.getValue("S-FIRST",""));
System.out.println("SECONDSTR:"+result1.getValue("S-SECOND",""));
System.out.println("THIRDSTR:"+result1.getValue("S-THIRD",""));
we are not sure why the datas have not been passed.. do anyone have any idea regarding this??
Thanks..Hi Wayne,
This is my view definition:
VIEW sample
# type cname fbna count flag size null
string firststr - 1 - 10 -
string secondstr - 1 - 10 -
string thirdstr - 1 - 10 -
ENDJolt repository file:
service=NSIMPSRV
export=true
inbuf=VIEW
inview=sample
outbuf=VIEW
outview=sample
param=FIRSTSTR
type=string
access=inout
param=SECONDSTR
type=string
access=inout
param=THIRDSTR
type=string
access=inoutThe Servlet code is:
package Servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import bea.jolt.pool.servlet.weblogic.PoolManagerStartUp;
import bea.jolt.pool.servlet.*;
import bea.jolt.pool.ApplicationException;
import bea.jolt.pool.SessionPoolException;
import bea.jolt.pool.ServiceException;
import bea.jolt.pool.SessionPoolManager;
import bea.jolt.pool.*;
* Servlet implementation class ZC00582Servlet
public class VIEWServlet extends HttpServlet {
private ServletSessionPoolManager joltsession = (ServletSessionPoolManager) SessionPoolManager.poolmgr;
public VIEWServlet() {
super();
// TODO Auto-generated constructor stub
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.setContentType("text/html");
ServletResult result;
Result result1;
String String1 = request.getParameter("FIRSTSTR");
String String2 = request.getParameter("SECONDSTR");
String String3 = request.getParameter("THIRDSTR");
System.out.println("THE VALUES BEFORE CONVERSION");
System.out.println("FIRSTSTR:"+String1);
System.out.println("SECONDSTR:"+String2);
System.out.println("THIRDSTR:"+String3);
System.out.println("1..");
//ServletResult message;
ServletSessionPool servletsession = (ServletSessionPool) joltsession.getSessionPool("demojoltpool");
System.out.println("2..");
ServletDataSet joltdataset = new ServletDataSet();
//joltdataset.importRequest(request);
System.out.println("3..");
//joltdataset.setValue("firststr","Hi");
joltdataset.setValue("firststr",String1);
System.out.println("4..");
//joltdataset.setValue("secondstr","hello");
joltdataset.setValue("secondstr",String2);
System.out.println("5..");
//joltdataset.setValue("thridstr","fine");
joltdataset.setValue("thirdstr",String3);
System.out.println("6..");
//result = (ServletResult) servletsession.call("NSIMPSRV", joltdataset, null);
result1 = servletsession.call("NSIMPSRV", joltdataset, null);
result = (ServletResult) result1;
System.out.println("THE VALUES AFTER CONVERSION");
System.out.println("FIRSTSTR:"+result.getStringValue("firststr",""));
System.out.println("SECONDSTR:"+result.getStringValue("secondstr",""));
System.out.println("THIRDSTR:"+result.getStringValue("thirdstr",""));
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
and my server program :
IDENTIFICATION DIVISION.
PROGRAM-ID. NSIMPSRV.
AUTHOR. TUXEDO DEVELOPMENT.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.
* Tuxedo definitions
01 TPSVCRET-REC.
COPY TPSVCRET.
01 TPTYPE-REC.
COPY TPTYPE.
01 TPSTATUS-REC.
COPY TPSTATUS.
01 TPSVCDEF-REC.
COPY TPSVCDEF.
* Log message definitions
01 LOGMSG.
05 FILLER PIC X(10) VALUE
"NSIMPSRV :".
05 LOGMSG-TEXT PIC X(50).
01 LOGMSG-LEN PIC S9(9) COMP-5.
* User defined data records
01 STRING-DATA.
COPY SAMPLE.
LINKAGE SECTION.
PROCEDURE DIVISION.
START-FUNDUPSR.
MOVE LENGTH OF LOGMSG TO LOGMSG-LEN.
MOVE "Started" TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
* Get the data that was sent by the client
MOVE LENGTH OF STRING-DATA TO LEN.
CALL "TPSVCSTART" USING TPSVCDEF-REC
TPTYPE-REC
STRING-DATA
TPSTATUS-REC.
IF NOT TPOK
MOVE "TPSVCSTART Failed" TO LOGMSG-TEXT
PERFORM DO-USERLOG
PERFORM EXIT-PROGRAM
END-IF.
IF TPTRUNCATE
MOVE "Data was truncated" TO LOGMSG-TEXT
PERFORM DO-USERLOG
PERFORM EXIT-PROGRAM
END-IF.
MOVE FIRSTSTR TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
MOVE SECONDSTR TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
MOVE THIRDSTR TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
INSPECT FIRSTSTR CONVERTING
"abcdefghijklmnopqrstuvwxyz" TO
"ABCDEFGHIJKLMNOPQRSTUVWXYZ".
INSPECT SECONDSTR CONVERTING
"abcdefghijklmnopqrstuvwxyz" TO
"ABCDEFGHIJKLMNOPQRSTUVWXYZ".
INSPECT THIRDSTR CONVERTING
"abcdefghijklmnopqrstuvwxyz" TO
"ABCDEFGHIJKLMNOPQRSTUVWXYZ".
MOVE "Success" TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
MOVE STRING-DATA TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
SET TPSUCCESS TO TRUE.
COPY TPRETURN REPLACING
DATA-REC BY STRING-DATA.
* Write out a log err messages
DO-USERLOG.
CALL "USERLOG" USING LOGMSG
LOGMSG-LEN
TPSTATUS-REC.
* EXIT PROGRAM
EXIT-PROGRAM.
MOVE "Failed" TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
SET TPFAIL TO TRUE.
COPY TPRETURN REPLACING
DATA-REC BY STRING-DATA.
Thanks & Regards,
Janani.
Maybe you are looking for
-
WebCam not functioning on cold boot. Reappear on reboot.
I just bought a TouchSmart 610t. I found out today if I start the computer from a power cycle (shut off and then power up), the webcam will go missing (no imaging device, question mark in unknown device dr in USB). If I reboot the computer (via CTR
-
Event Driven Message Processing in AAE
Hi SDNers, I wanted to know if PI 7.1 EhP1 supports event driven message processing on AAE, means can I bypass ABAP engine by configuring the scenario with ICo (Integrated Configation) and still use the event driven message processing of PI? Regards,
-
Cisco ASA HA Setup in ACTIVE - ACTIVE State
I have two ASA 5540s, with 8.4.(2).8 installed in a HA setup , they lost synchronisation last week, and now are both in ACTIVE mode. I have a PRIMARY/ACTIVE and a SECONDARY/ACTIVE. Is there any procedure to get back to PRIMARY/ACTIVE and SECONDARY/ST
-
Runtime.getRuntime(). Passing parameters
Hello, is it possible to pass input to a console application called by Runtime.getRuntime()? Concretely: I want to call "ij" of the Java/Derby DB system and make it process a command/script file. The following code run under WinXP returns 0 (success)
-
Disable Head Menu In GUI STATUS
Hello everyone, i have a gui-status that has a menu (with several options within it) and application toolbar. Im looking for a way to disable/remove the menu only , I know that the options within it can be disabled using EXCLUDE fcode but the menu he