Ajax call method which return json Data
Hi, I make one function , which i want to return json value , for this which return type i mention in function:
This is javascript which call Retrieve method.
<script>
debugger;
var remoteDatasource = new kendo.data.DataSource({
transport: {
read: {
type:"POST",
url: "Controllers/Home.cfc",
dataType: "json",
data: {
method: "Retrieve",
dataLists: JSON.stringify(request)
</script>
Home.cfc
component
remote function Retrieve(string dataLists)
try
q = new Query();
q.setsql("SELECT * FROM Product");
qResult = q.execute().getresult();
col_len = ListLen(qResult.Columnlist);
dataArray = ArrayNew(1);
row = 0;
col = 0;
for(row = 1; row <= len; row++)
for(col = 1; col <= col_len; col++)
FieldName = ListGetAt(qResult.Columnlist, col);
dataArray[row][col] = qResult[FieldName][col];
jsonvar=serializeJSON(dataArray);
catch(any e)
return jsonvar;
One can see immediately that you have to make the following corrections, at least:
Give the query a name;
Point the query to a datasource;
Define the variable 'len' (even better, use a different, less confusing, name for the variable).
Similar Messages
-
J2me Mobile client calling method which return byte[]
java.rmi.MarshalException: Expected Byte, received: SGVsbG8gV29ybGQ=
WebService1_Stub ws=new WebService1_Stub();
try {
String s=ws.getStringHelloWorld();// works fine
byte s[]=ws.helloWorld(); // error java.rmi.MarshalException: Expected Byte, received: SGVsbG8gV29ybGQ=
}catch(Expception e){
ex.printStackTrace();
}This same ws working fine in java standalone application please guide me what can be a problem ??
Regards
Haroon Idreesclear your app. server logs ( or make copies of them if will you need them) and redo the whole process. check out the logs and you should see some reason for this. i do not know if Borland's logs will turn out helpful, but it did help me out in certain other situations.
-
Call methods (which are in the servlet) in my response page
Hello !
I want to call methods which are in the servlet ( its name is ServletRecap) BUT the call is made in the response page which is generated by the servlet ServletRecap !
I just want to allow the user to update his choice in the response page.
example: i choice A in the initial form but i change my mind and now i want to choice B in the response page : the choice have to be update in the database.
the insertion in the DB is made by a method in the servlet : so i have to recall the method in the response page!
Please, anybody have an idea ?
my servlet :
public class ServletRecap extends HttpServlet {
// param�tres d'instance
private String urlErreurs = null;
private ArrayList erreursInitialisation = new ArrayList<String>();
private String[] param�tres = {"urlFormulaire", "urlReponse", "urlControleur", "lienRetourFormulaire"};
private Map params = new HashMap<String, String>();
// init
@SuppressWarnings("unchecked")
public void init() throws ServletException {
// on r�cup�re les param�tres d'initialisation de la servlet
ServletConfig config = getServletConfig();
// on traite les autres param�tres d'initialisation
String valeur = null;
for (int i = 0; i < param�tres.length; i++) {
// valeur du param�tre
valeur = config.getInitParameter(param�tres);
// param�tre pr�sent ?
if (valeur == null) {
// on note l'erreur
erreursInitialisation.add("Le param�tre [" + param�tres[i] + "] n'a pas �t� initialis�");
} else {
// on m�morise la valeur du param�tre
params.put(param�tres[i], valeur);
// l'url de la vue [erreurs] a un traitement particulier
urlErreurs = config.getInitParameter("urlErreurs");
if (urlErreurs == null) {
throw new ServletException(
"Le param�tre [urlErreurs] n'a pas �t� initialis�");
@SuppressWarnings("unchecked")
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
// on v�rifie comment s'est pass�e l'initialisation de la servlet
if (erreursInitialisation.size() != 0) {
// on passe la main � la page d'erreurs
request.setAttribute("erreurs", erreursInitialisation);
request.setAttribute("lienRetourFormulaire", "");
getServletContext().getRequestDispatcher(urlErreurs).forward(
request, response);
// fin
return;
// on r�cup�re la m�thode d'envoi de la requ�te
String m�thode = request.getMethod().toLowerCase();
// on r�cup�re l'action � ex�cuter
String action = request.getParameter("action");
// action ?
if (action == null) {
action = "init";
// ex�cution action
if (m�thode.equals("get") && action.equals("init")) {
// d�marrage application
doInit(request, response);
return;
if (m�thode.equals("post") && action.equals("validationFormulaire")) {
// validation du formulaire de saisie
doValidationFormulaire(request, response);
return;
if (m�thode.equals("post") && action.equals("enregistrementFormulaire")) {
// enregistrement du formulaire de saisie
doEnregistrementFormulaire(request, response);
return;
if (m�thode.equals("post") && action.equals("retourFormulaire")) {
// retour au formulaire de saisie
doRetourFormulaire(request, response);
return;
// autres cas
doInit(request, response);
// validation du formulaire
void doValidationFormulaire(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// on r�cup�re les param�tres
String nomCentre = (String) request.getParameter("nomCentre");
String idCentre = (String) request.getParameter("idCentre");
String nomPreleveur = (String) request.getParameter("nomPreleveur");
String datePrelev = (String) request.getParameter("datePrelev");
String numFinFiche = (String) request.getParameter("numFinFiche");
// qu'on m�morise dans la session
HttpSession session = request.getSession(true);
session.setAttribute("nomCentre", nomCentre);
session.setAttribute("idCentre", idCentre);
session.setAttribute("nomPreleveur", nomPreleveur);
session.setAttribute("datePrelev", datePrelev);
session.setAttribute("numFinFiche", numFinFiche);
// v�rification des param�tres
ArrayList<String> erreursAppel = new ArrayList<String>();
// le nom doit �tre non vide
nomCentre = nomCentre.trim();
idCentre = idCentre.trim();
nomPreleveur = nomPreleveur.trim();
datePrelev = datePrelev.trim();
numFinFiche = numFinFiche.trim();
if (nomCentre.equals("")) {
erreursAppel.add("Le champ [nomCentre] n'a pas �t� rempli");
if (idCentre.equals("")) {
erreursAppel.add("Le champ [idCentre] n'a pas �t� rempli");
if (nomPreleveur.equals("")) {
erreursAppel.add("Le champ [nomPreleveur] n'a pas �t� rempli");
if (datePrelev.equals("")) {
erreursAppel.add("Le champ [datePrelev] n'a pas �t� rempli");
if (!numFinFiche.matches("^\\s*\\d+\\s*$")) {
erreursAppel.add("Le champ [numFinFiche] est erron�");
// des erreurs dans les param�tres ?
if (erreursAppel.size() != 0) {
// on envoie la page d'erreurs
request.setAttribute("erreurs", erreursAppel);
request.setAttribute("lienRetourFormulaire", (String) params.get("lienRetourFormulaire"));
getServletContext().getRequestDispatcher(urlErreurs).forward(
request, response);
return;
// les param�tres sont corrects - on envoie la page r�ponse
request.setAttribute("nomCentre",nomCentre);
request.setAttribute("idCentre",idCentre);
request.setAttribute("nomPreleveur",nomPreleveur);
request.setAttribute("datePrelev",datePrelev);
request.setAttribute("numFinFiche",numFinFiche);
request.setAttribute("lienRetourFormulaire", (String) params.get("lienRetourFormulaire"));
getServletContext().getRequestDispatcher((String) params.get("urlReponse")).forward(request,
response);
return;
//enregistre dans la base de donn�e les variables
void doEnregistrementFormulaire(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
String nomCentre = (String) request.getParameter("nomCentre");
String idCentre = (String) request.getParameter("idCentre");
String nomPreleveur = (String) request.getParameter("nomPreleveur");
String datePrelev = (String) request.getParameter("datePrelev");
String numFinFiche = (String) request.getParameter("numFinFiche");
String nEtude = datePrelev + "." + idCentre + "." + numFinFiche;
// qu'on m�morise dans la session
HttpSession session = request.getSession(true);
session.setAttribute("nomCentre", nomCentre);
session.setAttribute("idCentre", idCentre);
session.setAttribute("nomPreleveur", nomPreleveur);
session.setAttribute("datePrelev", datePrelev);
session.setAttribute("numFinFiche", numFinFiche);
Connexion com = new Connexion();
try{
//serveur,login,pwd,database
com.loadDriverAndConnect("127.0.0.1","3306","root","root","");
com.execute("USE BIOTECH");
com.execute("INSERT INTO RECAP (NEtude,NomCentre,idCentre,nomPreleveur,datePrelev) " +
"values ('"+nEtude+"','"+nomCentre+"','"+idCentre+"','"+nomPreleveur+"','"+ datePrelev + "')") ;
com.close();
catch(Exception ex) {
System.err.println("\n*** SQLException caught in main()");
request.setAttribute("urlAction", (String) params.get("urlControleur"));
getServletContext().getRequestDispatcher((String) params.get("urlReponse")).forward(request,
response);
return;
// affichage formulaire pr�-rempli
void doRetourFormulaire(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
// on r�cup�re la session de l'utilisateur
HttpSession session = request.getSession(true);
// on pr�pare le mod�le du formulaire
// nom pr�sent dans la session ?
String nomCentre = (String) session.getAttribute("nomCentre");
if (nomCentre == null) {
session.setAttribute("nomCentre", "");
String idCentre = (String) session.getAttribute("idCentre");
if (idCentre == null) {
session.setAttribute("idCentre", "");
String nomPreleveur = (String) session.getAttribute("nomPreleveur");
if (nomPreleveur == null) {
session.setAttribute("nomPreleveur", "");
String datePrelev = (String) session.getAttribute("datePrelev");
if (datePrelev == null) {
session.setAttribute("datePrelev", "");
String numFinFiche = (String) session.getAttribute("numFinFiche");
if (numFinFiche == null) {
session.setAttribute("numFinFiche", "");
// urlAction
request.setAttribute("urlAction", (String) params.get("urlControleur"));
// on affiche le formulaire
getServletContext().getRequestDispatcher((String) params.get("urlFormulaire")).forward(
request, response);
return;
// post
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
// on passe la main au GET
doGet(request, response);
my initial form:%
// on r�cup�re les param�tres dans la session
String nomCentre=(String)session.getAttribute("nomCentre");
String idCentre= (String)session.getAttribute("idCentre");
String nomPreleveur = (String)session.getAttribute("nomPreleveur");
String datePrelev=(String)session.getAttribute("datePrelev");
String numFinFiche=(String)session.getAttribute("numFinFiche");
String urlAction=(String)request.getAttribute("urlAction");
%>
<html>
<head>
<title>Fiche répitulative - formulaire</title>
</head>
<body>
<center>
<img src="logoBiotech.jpg" align="left" alt="logo Biotech-Germande" width="5%"></img>
<h2>Fiche répitulative - formulaire</h2>
<br>
<hr>
<form action="<%= urlAction %>" method="post">
[... page setting: made by html language ...]
<td><input type="submit" name="action" value="validationFormulaire"></td>
<td><input type="reset" value="Rétablir"></td>
</tr>
</table>
</form>
</center>
</body>
</html>
my response page:<%
// on r�cup�re les donn�es
String nomCentre=(String)session.getAttribute("nomCentre");
String idCentre= (String)session.getAttribute("idCentre");
String nomPreleveur = (String)session.getAttribute("nomPreleveur");
String datePrelev=(String)session.getAttribute("datePrelev");
String numFinFiche=(String)session.getAttribute("numFinFiche");
String urlAction=(String)request.getAttribute("urlAction");
%>
<html>
<head>
<title>Fiche répitulative - formulaire</title>
</head>
<body>
<form action="<%= urlAction %>" method="post">
[... page setting: made by html language ...]
<br><br>
<td><input type="submit" name="action" value="enregistrementFormulaire"></td>
<td><input type="submit" name="action" value="retourFormulaire"></td>
</body>
</html>
my web.xml:<!-- Servlets -->
<!--Servlet Fiche Recapitulative-->
<servlet>
<servlet-name>FicheRecap</servlet-name>
<servlet-class>germande.ServletRecap</servlet-class>
<init-param>
<param-name>urlReponse</param-name>
<param-value>/WEB-INF/JSP/Recap/reponseRecap.biotech.jsp</param-value>
</init-param>
<init-param>
<param-name>urlErreurs</param-name>
<param-value>/erreursRecap.biotech.jsp</param-value>
</init-param>
<init-param>
<param-name>urlFormulaire</param-name>
<param-value>/WEB-INF/JSP/Recap/formulaireRecap.biotech.jsp</param-value>
</init-param>
<init-param>
<param-name>urlControleur</param-name>
<param-value>ServletRecap</param-value>
</init-param>
<init-param>
<param-name>lienRetourFormulaire</param-name>
<param-value>Retour au formulaire</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>FicheRecap</servlet-name>
<url-pattern>/ServletRecap</url-pattern>
</servlet-mapping>
</web-apps>
Thanks in advance for your idea.
I resume : how can I call a method in my servlet into my response page (in jsp).
the servlet generate this response page and i just want to update the choice of my user.
Thanks !!I resume : how can I call a method in my servlet into my response page (in jsp).Don't do that. Put the message into a plain old Java class which can be called from both the servlet and the JSP.
-
Defining enum with abstract method which returns a generic type
Is it possible to define an abstract method which returns an geneic type like below? Thanks
public enum Type{
A{
public List<Integer> getData(){}
B{
public Set<String> getData{}
abstract<T> T getData();
}vulee wrote:
Why not?
List<Integer> lst = Type.A.getData();Wonder, which compiler you use. Can't be Java6:
# javac Enums.java
Enums.java:23: incompatible types
found : java.util.Collection<capture#376 of ?>
required: java.util.List<java.lang.Integer>
List<Integer> data = Type.A.getData();
^
1 errorEdit: Unless you do it the generic way as you proposed, which actually is a phoney. Because of the T being a generic method parameter, the compiler will infer it from the type of the variable it gets assigned to. Hence, both of the following will compile:
List<Integer> lst = Type.A.getData();
Set<String> lst2 = Type.A.getData(); // Runtime exceptionActually, javac is telling you that giving warnings on the enum constants redefined method return types.
Edited by: stefan.schulz on Sep 10, 2008 11:38 PM -
Handling Methods which return Objects
I have a class called GenericObjectQueue, which essentially maintains a queue of objects.There is a method called getTopObject() which returns the first Object in the queue.
I use this class to maintain a queue "CustomerQ" of objects of the class "Customers ".Now when i write the following statements i get an error
customer firstcust= new customer();
firstcust= CustomerQ.getTopObject();
The compiler says incompatible types,
found : java.lang.Object
required: customer
How do I deal with this?
Thanks...RJ2method called getTopObject() which returns the first
Object in the queue.Another way is to set the return type as 'Customer' in place of Object and return a Custome -
Function or method which returns the full PDC path of webdynpro iview
Hi All,
I have created a webdynpro application and created a webdynpro Iview in portal and attached this view to a role. I am looking for any standard function module or method which returns the full PCD path of the webdynpro iview, when it executed from portal.
Regards,
H.K.Hayath Basha.Well in ABAP, we don't have portal APIs to access potal catalog info.
The only available Portal Interface is IF_WD_PORTAL_INTEGRATION
Abhi -
Table name in which return item data is stored of a PO
Can some please specify the table name in which return item data is stored of a PO?
Thanks in advance;Hi,
Let me explain what exactly I need. In a PO there is a checkbox "Retun Item". If we check that checkbox for an item that item becomes a retun item.
I need to fetch all the data of this return Item. The commitment data goes to table COOI but this return item records doesn't get stored in COOI table. I need all the data of this entry including the Network Activity, Project, WBS element etc.
Please let me know if you could help me.
Thanks. -
Looping over method which returns a query
HI,
I have a method that returns a query, I pass into this method
a ID number, which the query uses in the where clause. Now I have
another query which returns a list of ID numbers that I loop
through calling the first method and passing in the ID number, for
example
methodA
loop through methodA results
call methodB passing in methodA.ID
get results from methodB
close loop
now the problem I'm having is that methodB returns a query
and I want to be able to return the results from methodB as one
single query structure. I'm not sure how many times I will loop
through the results from methodA, it could be twice, it could by
ten time. So the results from calling methodB could be very large.
How can I add the results from methodB into one single query
structure?how about creating an empty query with cfset newQuery =
QueryNew([list of columns]);
and then on each loop through method B add a new row to this
new query, and then return that query as result? -
JSF 2.0 AJAX, calling method from commandButton
I am trying to make an ajax call to a method in a backing bean when I click on a command button. In reality the method will persist or update my entity, but in this sample it will just compare a user and password and set a boolean. In the sample I would like to have the commandButton call "doLogin". Or add a second second commandButton that just calls the method by its self. TIA
This is the form
<h:form>
<h:panelGroup id="edit2" >
<h:inputText id="editInput" value="#{StringHolder.str}" />
<br/>
<h:inputSecret id="inputPasswd" value="#{StringHolder.password}" />
<br/>
<h:outputText id="editOutput" value="#{StringHolder.str}" /><br/>
<h:selectBooleanCheckbox id="inOrNot" value="#{StringHolder.loggedIn}"/><br/>
<h:commandButton value="Submit" id="submit">
<f:ajax execute="editInput inputPasswd" render="editOutput inOrNot"/>
</h:commandButton><br/>
</h:panelGroup>
</h:form>This is the backing bean:
@ManagedBean(name="StringHolder")
@SessionScoped
public class StringHolder {
private String str;
private String password;
private boolean loggedIn;
/** Creates a new instance of StringHolder */
public StringHolder() {
* @return the str
public String getStr() {
return str;
* @param str the str to set
public void setStr(String str) {
this.str = str;
* @return the password
public String getPassword() {
return password;
* @param password the password to set
public void setPassword(String password) {
this.password = password;
* @return the loggedIn
public boolean isLoggedIn() {
return loggedIn;
public void doLogin() {
if(str.equals("user") && password.equals("password")){
loggedIn = true;
} else {
loggedIn = false;
}Ok, I figured it out.
<h:commandButton value="Submit" id="submit" actionListener="#{StringHolder.doLogin}">
<f:ajax execute="editInput inputPasswd" render="editOutput inOrNot"/>
</h:commandButton><br/> -
Autotype ant task and java source file having method which returns hashmap
Hi Friends,
I am using autotype ant task to generate types.xml and supporting java classes.
The task is defined as follows .
<target name="std">
<source2wsdd javaSource="HelloWorld.java"
typesInfo="types.xml"
ddFile="ddfiles/web-services.xml"
serviceURI="/HelloWorldService"/>
</target>
In my java source i have method which is returning an HashMap. In this scenario I am getting error when i run the task. The error is as follows
C:\test-ws\javaclass>ant auto
Buildfile: build.xml
auto:
[autotype] Autotyping for javaTypes TestBean
[autotype] weblogic.xml.schema.binding.BindingException: Invalid class received
: interface java.util.Map loaded from file:/C:/bea/jdk142_05/jre/lib/rt.jar!/jav
a/util/Map.class. All classes that will be serialized or deserialized must be n
on-interface, non-abstract classes that provide a public default constructor
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.en
sureValidClass(JavaInspector.java:1050)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.fi
llDescriptor(JavaInspector.java:174)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.ge
tDescriptor(JavaInspector.java:139)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.cr
eateBeanProperty(JavaInspector.java:927)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.cr
eateBeanProperty(JavaInspector.java:905)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.ad
dPropertiesToScalar(JavaInspector.java:834)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.fi
llDescriptor(JavaInspector.java:209)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.ge
tDescriptor(JavaInspector.java:139)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.cr
eateDescriptorForClass(JavaInspector.java:106)
[autotype] at weblogic.xml.schema.binding.internal.codegen.Compiler.compile
(Compiler.java:106)
[autotype] at weblogic.xml.schema.binding.internal.XSDTypeMappingBuilder.ma
pClass(XSDTypeMappingBuilder.java:89)
[autotype] at weblogic.xml.schema.binding.internal.XSDTypeMappingBuilder.ma
pClass(XSDTypeMappingBuilder.java:102)
[autotype] at weblogic.xml.schema.binding.internal.TypeMappingBuilderBase.a
ddMapping(TypeMappingBuilderBase.java:180)
[autotype] at weblogic.webservice.tools.build.internal.Java2SchemaImpl.doTy
peMapping(Java2SchemaImpl.java:267)
[autotype] at weblogic.webservice.tools.build.internal.Java2SchemaImpl.run(
Java2SchemaImpl.java:167)
[autotype] at weblogic.ant.taskdefs.webservices.javaschema.JavaSchema.doJav
a2Schema(JavaSchema.java:302)
[autotype] at weblogic.ant.taskdefs.webservices.javaschema.JavaSchema.execu
te(JavaSchema.java:184)
[autotype] at org.apache.tools.ant.Task.perform(Task.java:341)
[autotype] at org.apache.tools.ant.Target.execute(Target.java:309)
[autotype] at org.apache.tools.ant.Target.performTasks(Target.java:336)
[autotype] at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[autotype] at org.apache.tools.ant.Project.executeTargets(Project.java:1255
[autotype] at org.apache.tools.ant.Main.runBuild(Main.java:609)
[autotype] at org.apache.tools.ant.Main.start(Main.java:196)
[autotype] at org.apache.tools.ant.Main.main(Main.java:235)
BUILD FAILED
file:C:/test-ws/javaclass/build.xml:62: weblogic.webservice.tools.build.WSBuildE
xception: Failed to do type mapping - with nested exception:
[weblogic.xml.schema.binding.BindingException: Invalid class received: interface
java.util.Map loaded from file:/C:/bea/jdk142_05/jre/lib/rt.jar!/java/util/Map.
class. All classes that will be serialized or deserialized must be non-interfac
e, non-abstract classes that provide a public default constructor]
Can any one provide the solution for this
Thanks
AnanthaHi Friends,
I am using autotype ant task to generate types.xml and supporting java classes.
The task is defined as follows .
<target name="std">
<source2wsdd javaSource="HelloWorld.java"
typesInfo="types.xml"
ddFile="ddfiles/web-services.xml"
serviceURI="/HelloWorldService"/>
</target>
In my java source i have method which is returning an HashMap. In this scenario I am getting error when i run the task. The error is as follows
C:\test-ws\javaclass>ant auto
Buildfile: build.xml
auto:
[autotype] Autotyping for javaTypes TestBean
[autotype] weblogic.xml.schema.binding.BindingException: Invalid class received
: interface java.util.Map loaded from file:/C:/bea/jdk142_05/jre/lib/rt.jar!/jav
a/util/Map.class. All classes that will be serialized or deserialized must be n
on-interface, non-abstract classes that provide a public default constructor
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.en
sureValidClass(JavaInspector.java:1050)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.fi
llDescriptor(JavaInspector.java:174)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.ge
tDescriptor(JavaInspector.java:139)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.cr
eateBeanProperty(JavaInspector.java:927)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.cr
eateBeanProperty(JavaInspector.java:905)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.ad
dPropertiesToScalar(JavaInspector.java:834)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.fi
llDescriptor(JavaInspector.java:209)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.ge
tDescriptor(JavaInspector.java:139)
[autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.cr
eateDescriptorForClass(JavaInspector.java:106)
[autotype] at weblogic.xml.schema.binding.internal.codegen.Compiler.compile
(Compiler.java:106)
[autotype] at weblogic.xml.schema.binding.internal.XSDTypeMappingBuilder.ma
pClass(XSDTypeMappingBuilder.java:89)
[autotype] at weblogic.xml.schema.binding.internal.XSDTypeMappingBuilder.ma
pClass(XSDTypeMappingBuilder.java:102)
[autotype] at weblogic.xml.schema.binding.internal.TypeMappingBuilderBase.a
ddMapping(TypeMappingBuilderBase.java:180)
[autotype] at weblogic.webservice.tools.build.internal.Java2SchemaImpl.doTy
peMapping(Java2SchemaImpl.java:267)
[autotype] at weblogic.webservice.tools.build.internal.Java2SchemaImpl.run(
Java2SchemaImpl.java:167)
[autotype] at weblogic.ant.taskdefs.webservices.javaschema.JavaSchema.doJav
a2Schema(JavaSchema.java:302)
[autotype] at weblogic.ant.taskdefs.webservices.javaschema.JavaSchema.execu
te(JavaSchema.java:184)
[autotype] at org.apache.tools.ant.Task.perform(Task.java:341)
[autotype] at org.apache.tools.ant.Target.execute(Target.java:309)
[autotype] at org.apache.tools.ant.Target.performTasks(Target.java:336)
[autotype] at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[autotype] at org.apache.tools.ant.Project.executeTargets(Project.java:1255
[autotype] at org.apache.tools.ant.Main.runBuild(Main.java:609)
[autotype] at org.apache.tools.ant.Main.start(Main.java:196)
[autotype] at org.apache.tools.ant.Main.main(Main.java:235)
BUILD FAILED
file:C:/test-ws/javaclass/build.xml:62: weblogic.webservice.tools.build.WSBuildE
xception: Failed to do type mapping - with nested exception:
[weblogic.xml.schema.binding.BindingException: Invalid class received: interface
java.util.Map loaded from file:/C:/bea/jdk142_05/jre/lib/rt.jar!/java/util/Map.
class. All classes that will be serialized or deserialized must be non-interfac
e, non-abstract classes that provide a public default constructor]
Can any one provide the solution for this
Thanks
Anantha -
Ajax call failed, htmlDB_get return null
Hi,
I'm having some problem at ajax call. I'm always getting null return value after htmldb_Get.get() function.
Tried to follow some examples in this forum,
in Html header, i have:
<script language="JavaScript" type="text/javascript">
function simple()
var ajaxRequest = new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=simple',0);
alert('ajaxRequestis '+ ajaxRequest);
ajaxResult = ajaxRequest.get();
alert('ajaxResult is '+ ajaxResult);
if (ajaxResult)
html_GetElement('UserListDiv').innerHTML = ajaxResult;
else
html_GetElement('UserListDiv').innerHTML = 'null';
ajaxRequest = null;
</script>
The application level process "simple" is really simple (on_demand):
begin
-- Set the MIME type
owa_util.mime_header( 'application/xml', FALSE );
-- Close the HTTP Header
owa_util.http_header_close;
htp.prn('<?xml version="1.0" ?><abc><def>123</def></abc>');
htmldb_application.g_unrecoverable_error := true;
end;
After runing the page, the first alert print I've got "object Object".
and the second is always null.
I've been working on that for days, and I can not follow Carl's cascading select list example for the same reason, please advice!!!Did this ever get figured out? I'm doing a cascading LOV and coming back with an emply LOV. I put alerts in as well as am definitely not getting any thing back from the application process.
function get_AJAX_SELECT_XML(pThis,pSelect){
var l_Return = null;
var l_Select = $x(pSelect);
var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=otn_Select_XML',0);
get.add('TEMPORARY_ITEM',pThis.value);
gReturn = get.get('XML');
alert_text = get.get();
alert(alert_text);
if(gReturn && l_Select){
var l_Count = gReturn.getElementsByTagName("option").length;
alert_text = l_Count;
alert(alert_text);
... not including rest of the function...
For now, simplified application process just to see if anything was being returned...
declare
l_counter number;
l_o_name varchar2(2000);
begin
owa_util.mime_header('text/xml', FALSE );
htp.p('Cache-Control: no-cache');
htp.p('Pragma: no-cache');
owa_util.http_header_close;
htp.prn('<select>');
htp.prn('<option value="' || rec.id || '">' || rec.name || '</option>');
end loop;
htp.prn('<option value="11111111">test</option>');
htp.prn('</select>');
end; -
Help creating a formula which returns current date last year
I need help creating a formula which returns the current date last year. I also need it to work during leap years.
Any ideas?Hi Dagros,
I'm lucky to be a universe designer, I have to do this only once
The easiest way would probably be to use
=RelativeDate(CurrentDate();-365)
So subtractiing 365 to get the same date last year,
but you would need some extra logic for the years with a feb 29 in those 365 days.
=If FormatDate(RelativeDate(CurrentDate();-365);"dd") = FormatDate(CurrentDate();"dd")
Then RelativeDate(CurrentDate();-365)
Else RelativeDate(CurrentDate();-366)
Another question to ask is if you really want the same date last year, or if you also want a really 'same day' so monday compared to monday etc. in this case you would just subtract 364 days and get the day 52 weeks back...
Good luck,
Marianne -
Strange issue - WD4A when called from EP returns wrong data
Hi Experts,
I am facing a very strange issue with WD4A. I have created one RFC. WD4A program calls this RFC. When I am executing the RFC using se37 it gives me 10 records. When I am executing the same RFC from WD4A program (Web Dynpro Application -- Right Click -
test) the program is returning 10 records.
I have created one iView in Portal. When I am calling the same program from portal, sometimes it returns 9 records and sometimes 10 records. I just refresh the iview and no of records getting displayed in screen changes.
I have cheked the code many times. The code is perfectly fine.
I have used clear and refresh command in the beginigng of RFC.
What may be wrong? I have wasted my full dayfor resolving the issue. But I could not succeed.
Is it due to some BASIS issue? Is it due to some server session issue?
I have used business graphics in my application. Is it due to this? Whether IGS server and ECC contain different data?
Please suggest
Regards,
GaryHi Experts,
The System configuration in the EP is pointing to the right system and right client. I am using same setting for other Iviews. The other iViews are working fine.
How we can apply break point in WDA. I beliveve I have to meet following requirement:
1) Suppose EP user is 4755. The EP user 4755 is mapped to R/3 user 4755 and R/3 pernr 4755.
2) Backend R/3 user 4755 should have se80
3) Backend R/3 user should have debug access.
The authorization will not provide such accesses for backend user 4755.
Do we have any workaround?
Please help.
Regards,
Gary -
Call program and return with data
Hi, Experts,
I have called a program from my main program using SUBMIT
and return.
I need to get data back from called program in table format.
Is there any way to fullfill such requirement.
Regards
Rajiv singh.if the program is custom , then you can use import and export option. you can export the data to memory in the submit program, and import from memory after submit call.
if it Standard program , in some standard programs also will export data to memory , so check in inside the program. -
How do I deal with a Java method which returns a class object?
Hi, I am using JNI to talk to some Java code from c++;
I have a java method in class B that is defined as
class B{
A[] As;
A getA(int i){
return As(i);
where A is one of my classes.
I would like to know the code to deal with a returned object of type A and then how to access the variables in A from c++.
I have defined my method pointer as :
env->GetMethodID(B, "getA", "(I)A;");and have the jclass object of type A.
Would I do something like jclass A_CLASS = env->FindClass("A");
jobject A_OBJECT = (A_CLASS)env->CallObjectMethod(B,getA, i) ; If so, how do I then access the fields in A_OBJECT? Please let me know, thanks.ilganeli wrote:
Thanks but this doesn't really help. I know how this is done in Java (see below).Presumably you also understand how that code will fail. At least based on what you have posted here.
I do not understand the syntax to do the equivalent thing in JNI, specifically, how to cast the returned object from the CallObjectMethod function to be of the appropriate type, namely A, and then how to access those fields. You don't cast it. Didn't do so in your java code either.
But you define how you are going to attempt to access any object in JNI. If you mess up it fails.
Maybe you are looking for
-
How do I sync multiple iPones on the same iMac
How do I sync multiple iPones on the same iMac
-
Three types of DSO in BI 7.0
Hi, I went through the sap help documents related to the three types of DSO. 1. Standard 2. Direct Update 3. Write Optimized Still not clearly understood in which case we use what kind of DSO's. Could any one explain me that in your own words. I am
-
Create case with vi:s from folder
I want to create a case with n number of sub vi inside. I have a folder containing n number of vi:s, they all have the same inputs and outputs. My problem is that I dont know how many there is and I want to be able to open a specific one depending on
-
What component is placed default in each cell of JTable?
Hi, What component is placed default in each cell of JTable?
-
I phone so slow after update to 4.0.2
hi guys wondering if anyone can help me here? i have got the iphone 3g never hadany problem with it what so ever untill i updated software to 4.0 no its so slow sometime haveto wait 10 seconds to read a mesaage can u re install earlier software ? hel