Call method on servlet by clicking command_button

To all Jdever's 11g guru's
i usually use jdev 10g, but now i try to exercise with jdev 11g and i have an question [newbie on 11g]
i have command_button in browseGoods page and in that button i have a method "onSearch" on "browseGoodsAction.java"
my onSearch method
public void onSearch (DataActionContext ctx) throws Exception{
String nama = ctx.getHttpServletRequest().getParameter("nama");
String dateStart = ctx.getHttpServletRequest().getParameter("dateStart").toString().toUpperCase();
String dateEnd = ctx.getHttpServletRequest().getParameter("dateEnd").toString().toUpperCase();
String status ="A";
if (nama.length()==0 || nama == null){
nama = "%%";
if (nama.equalsIgnoreCase("all")){
nama = "ALL";
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
if (dateStart.length()==0 || dateStart == null){
and if i double click the command_button the generic method is
public String Search() {
// Add event code here...
return null;
not
public void Search(){
that i was made.
How to call that method when i click the commnad_button,..and bean that servlet???
cauze i'm not so understand when i follow the "*cue card*" on OTN
thanks for all guru's response and help
Edited by: kang dadang on Jan 5, 2010 8:39 PM

Hi Frank, thanks for u'r answer and response
I usual use jdev 10.1.2 UIX & JSP version, and i know that "*DataActionContext*" is depricated on Jdev11g.
If i have message textInput / inputText on 11g for search input, and inputText parameter name is for ex : goodsName : in properties inputText name field
how to put inputText parameter name ? is in the Property Inspector, Common section, the Value field ?
and how to get parameter name in inputText on jdev11g ?
I usual use this for UIX or JSP on Jdev 10.1.2
public void onSearch (DataActionContext ctx) throws Exception{
String nama = ctx.getHttpServletRequest().getParameter("nama");
String dateStart = ctx.getHttpServletRequest().getParameter("dateStart").toString().toUpperCase();
String dateEnd = ctx.getHttpServletRequest().getParameter("dateEnd").toString().toUpperCase();
thanks Frank for your answer

Similar Messages

  • Calling method from servlet

    hi,
    I want to call a method of an object that is available in a program already running, with parameters passed from the servlet.
    How to do it .
    Thanks.

    Pls be patient with me. I tried my best and couldn't achieve what I want.
    I provide the skeleton of what I have done and what I want to do.
    I have my core part in /home/raja/Service/Core.java, the only java file in Service folder. When I compile it I get some four class files(which are used in Core.java file internally). I don't compile it as a package but as a single file.
    I run the program in the same folder and in main method I use an infinite loop to keep the program running infinitely.
    And I have a html as, usr/local/jakartaTomcat../webapps/servlets-examples/input.html. which simply gets an input string and submits to /servlet/Insert servlet class which is in ../servlets-examples/classes/Insert.class.
    It put the string in DB which works fine. Also I made a package in ...servlet-examples/classes/Service in which I uploaded Core.java and compiled it and got the class files in it as a package.
    In Insert class file I imported Service.*. In Insert class file I put a line like this. Core.putInPool(submittedString) which is a static method.
    When I submit input.html , the string is put in DB, but it is not submitting to the program already running.
    What I want to do is, I want to submit the string to the program that is running in /home/raja/Service/.
    This is the program running in /home/raja/Service.
    public class Core {
         static ThreadPool bc= new ThreadPool(10);
         public static void putString(String someStr) {
              bc.putInPool(someStr);
         public static void main(String args[]) throws InterruptedException {
              BufferedReader dataIn = new BufferedReader(new InputStreamReader( System.in) );
              while(true) {
                   System.out.println("\f 1.Insert\n2.option2Enter Ur choice:");
                   try{
                        ch = Integer.parseInt(dataIn.readLine());
                                   String string="";
                        switch(ch) {
                             case 1: System.out.println("\nEnter the String:");
                                  string = dataIn.readLine();
                                  bc.putInPool(string);
                                 .....In Insert.class servlet,
                                    string = req.getParameter("userInputString");
                                    out.println("Submitted");
                        Core.putInPool(string);

  • Calling a method of servlet

    How to call a method of servlets like we do in struts like "get.do?method=getData". I know servlets are called defacult method either dopost or doget are called but can i call any other in the servlet and if yes how can i do that?

    May be your servlet is not able to lookup the EJB. You can use some print statements and see whether lookup ok or not.
    Just a guess.
    Plese get back, if any queries.
    Thanks,
    Rakesh.

  • Getting error while calling ejb business methods from servlet

    Hi
    Iam getting error when i try to call a ejb method from servlet.Error is
    "com.netscape.server.eb.UncheckedException: unchecked exception nested exception is:java.lang.NullPointerException".
    I build the application and deployed it successfully.Iam using IAS 6.O with windows NT 4.0.
    This is just a method which takes values from database and return as an array of bean to servlet.
    Any help on this.Thanks Shank

    Hi
    I was using the session bean.Your suggestion helped me a lot.Perfect.
    I debug my program and found that from ejbCreate()exception is getting.
    I was getting the datasource object thro ejb create() initialisation.
    Somehow the look up jndi which i mentioned was not interpretting from ejb-jar.xml ias-ejb-jar.xml and datasource ref .Due to this iam getting jndi Namenotfound exception which in turns to null pointer as datasource is getting null.
    when i hardcoded in the ejb the the jndi name for datasource it is working fine.Bit worried all the existing ejbs working with the xml referenced datasource and jndi,but when i added a new ejb with same properties it is failing to get the jndi name.
    Piece of code from ias-ejb-jar.xml
    <resource-ref>
              <res-ref-name>myDataSource</res-ref-name>
              <jndi-name>jdbc/nb/myData</jndi-name>
    </resource-ref>
    Piece of code from ejb-jar.xml
    <resource-ref>
              <res-ref-name>myDataSource</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
    </resource-ref>
    Thanks a lot meka

  • Why Do We Have To Call super.init(config); in init() method of servlet?

    Hi, everyone..
    I wonder why we call super.init(config) in init method of servlet... If i dont call it ; when i try to get servletcontext in service method it throws java.lang.NullPointerException...when we call super.init() , what is happening behind the scene? If anybody has a technical explanation for my question , i will be very pleased...
    THX FOR YOUR FUTURE REPLIES IN ADVANCE....

    I am sorry about the uppercases and i dont want to seem smart on java forums... Anyway, m8 this is the thing that i know... i meant; for instance when we override doGet or doPost method ; we dont need to override init method; but the server loads the servlet and we can get the context of the servlet in these methods easily by calling getServletContext() method; however when we want to call service method implicitly by jndi, servlet needs to be loaded and init method must call its parent...(i also write down in web.xml <load-on-startup>.... for that servlet).
    thx for your replies in advance....

  • Who calls doget() method of servlet

    hello all,
    i have typical customized webserver.
    the problem i have with that is when i configure it with IP address and when i send a request through browser using HOST NAME ,its not recognizing.
    the same happens vice versa
    that is : set up host name in the http server, and when try a request through IP Address using a web browser.
    can any body clear me who calls the doGet() method of servlet. if it is USER AGENT of web browser, is there any operation executes between
    USER AGENT - DoGet() method of servlet?
    regards
    R
    Message was edited by:
    LoveOpensource

    The servlet is on the server, the browser is on the client, so, do it think it possible (unless the browser is written in Java and does it's browsing with RMI, which is patently absurd) that the browser call doGet()?
    It is rather obvious, that the browser sends an HTTP request to the Application Container (or a web server such as apache which then uses some module to communicate with the Application Container, but the end effect is the same), and that Application Container calls the doGet() method.
    Edit: And man am I slow and "wordy".

  • 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&eacute;pitulative - formulaire</title>
    </head>
    <body>
    <center>
         <img src="logoBiotech.jpg" align="left" alt="logo Biotech-Germande" width="5%"></img>
    <h2>Fiche r&eacute;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&eacute;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&eacute;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.

  • Why doGet() method wil be called default in servlet

    hi
    my first question is
    1.why doGet() method wil be called up first instead of doPost() method in servlet. .
    2. How to identify the browser disables the cookies.
    please help me to this questions.
    Thank u in advance.

    hi
    my first question is
    why doGet() method wil be called up first instead of
    doPost() method in servlet.This is not correct. doGet or doPost getting called depending on the request method of the HTTP request. If the request method is GET then doGet will get called, if the request method is POST then doPost will get called.
    By the way there are other request methods. If a request arrives with one of those request methods the corresponding doXXX method wil get called.
    2. How to identify the browser disables the
    cookies. There is no direct method. What you can do is set a cookie and then see if it is sent back with the next request from the same browser session.

  • How to call two different servlet-url in the same application

    Hi,
    I want to call, consecutively these methods in my application.
    response.sendRedirect(servlet-url1)
    reponse.sendRedirect(servlet-url2)
    but the second method dont answer,
    I think, the first method redirect s with response ,
    but how to call two different servlet ?
    thanks

    if you call the first redirect, the servlet is getting aborted, so you can redirect to the first servlet, working the stuff in it, and then in the second servlet you can redirect to the third servlet

  • Calling 3 different servlets from a single servlet

    hi all,
    i am in lot of soup...i am new to servlets,etc....so help me pls.
    i need to call 3 different servlets from one servlet. all 3 servlets that i want to call perform different functions and execute queries on the database.
    what i am trying to do is:
    there is an html page that call a servlet called authenticate.java.(whose code is at the bottom of this page).
    the servlet authenticate.java should authenticate a user according to the password and username supplied in the html page.
    MAINLY:-
    i need to display 3 buttons to the authenticted user. those 3 buttons each should call 3 different servlets, which do different things.
    now in authenticte.java i set certain information in the session using session.putValue();
    further, whatever servlet is called, i need to use that information i set into the session...using session.getValue().
    PLS TELL ME HOW TO DO THAT...ALSO C IF THE BELOW CODE IS OK.
    ALSO TELL ME HOW TO END A SESSION. ALSO DO SERVLETS SUPPORT SESSIONS?
    I AM USING jdk1.3 and jsdk2.0.
    * Authenticate.java
    // this places all user variables in session
    //to access use session.getAttribute
    //dispatcher stuff
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    * @author Gudiya
    * @version
    public class Authenticate extends HttpServlet {
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    HttpSession session = request.getSession(true);
    Connection con=null;
    String sessionid;
    String deptcode;
    String desig;
    String add1;
    String add2;
    String contname;
    PrintWriter out = response.getWriter();
    try
    {System.out.println(1);
    response.setContentType("text/html");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:SACFA","","");
    System.out.println("connection established");
    catch(ClassNotFoundException e){
    System.out.println("database driver not found");
    System.out.println(e.toString());
    catch(Exception e){System.out.println(e.toString());
    String username=request.getParameter("username");
    String password=request.getParameter("password");
    try{
    System.out.println(2);
    PreparedStatement stmt=con.prepareStatement("SELECT * FROM AUTHENTICATION,mb_add where AUTHENTICATION.NAME=? AND AUTHENTICATION.PASSWORD=? AND mb_add.DEPT_NAME=?");
    stmt.setString(1,username);
    stmt.setString(2,password);
    stmt.setString(3,username);
    ResultSet rs=stmt.executeQuery();
    System.out.println(3);
    boolean rowfound=false;
    rowfound=rs.next();
    if (rowfound==true)
    sessionid=session.getId();
    System.out.println(sessionid);
    System.out.println(4);
    session.putValue("user",username);
    rs.beforeFirst();
    while (rs.next())
    System.out.println(5);
    deptcode=rs.getString("DEPT_CODE");
    desig=rs.getString("DESIGNATION");
    add1=rs.getString("ADDRESS1");
    add2=rs.getString("ADDRESS2");
    contname=rs.getString("NAME");
    session.putValue("dept_code",deptcode);
    session.putValue("designation",desig);
    session.putValue("address1",add1);
    session.putValue("address2",add2);
    session.putValue("cont_name",contname);
    System.out.println(6);
    }          out.println("<html>");
              out.println("<head>");
              out.println("<title>Successful Login Screen</title>");
              out.println("</head>");
              out.println("<body bgcolor='ORANGE'>");
    out.println("WELCOME SACFA MEMBERS FROM "+ username);
    //print decorative html statements here
              out.println(" SELECT ANY ONE ACTION:-");
    //out.println("<form Action="+"\"servlet/noc\""+" method =post>");//call for your noc servlet
    //print decorative html statements here
    out.println("<INPUT TYPE=submit VALUE='GENERATE NOC' NAME='NOC'>");
    out.println("</form>");
    //print decorative html statements here
    //out.println("<form Action="+"\"servlet/comments\""+" method =post>");//call for your comment servlet
    out.println("<INPUT TYPE=submit VALUE='ENTER/ MODIFY COMMENTS' NAME='COMMENTS' >");
    out.println("</form>");
    //print decorative html statements here
    // out.println("<form Action="+"\"servlet/bye\""+" method = post>");
    out.println("<INPUT TYPE=submit VALUE=EXIT NAME=EXIT >"); //place javascript fucction for exiting window
    out.println("</form>");
              out.println("</body>");
              out.println("</html>");
    con.close();
    } catch( SQLException e){ }
    out.close();}
    THANK YOU,
    REGARDS,
    ASHNA

    Hi Ashna,
    You have use three different forms for three buttons. But I think all are commented one.It will also work if you uncomment it.
    Else you can use only one Form without giving action in form tag. Use normal buttons instead of submit type buttons & call different JavaScript functions on onClick event for each button.
    Try this out.
    Ajay

  • Tomcat 6 – Calling a  Java Servlet from a JSP Page

    Below is a very simple JSP Page that calls a Java Servlet. The question is given Tomcat security constraints, is it possible to call a servlet from a JSP and get the correct output without getting an error message? If so, how would you code the web.xml file?
    c:\apache-tomcat-6.0.18
    Under conf
    catalina
    localhost
    HelloWorldExample.xml is directly under localhost
    The application would have this directory structure:
    webapps
    HelloWorldExample
    hello.jsp is directly under HelloWorldExample
    Under HelloWorldExample
    src
    WEB-INF
    classes
    Under classes
    jservlets
    HelloWorld.java is in src folder
    HelloWorld.class is in jservlets folder
    HelloWorldExample.xml
    <Context path="/HelloWorldExample" docBase="HelloWorldExample" debug="0"
          reloadable="true" crossContext="true">    
    </Context>**************************
    hello.jsp
    <HTML>
    <HEAD>
    <TITLE>Hello</TITLE>
    </HEAD>
    <BODY>
    <FONT SIZE="4">
    <P>
    Please enter your name:
    <FORM 
       METHOD="Post"
       ACTION="servlet/jservlets.HelloWorld">
    <TABLE BORDER="3" CELLPADDING="1" WIDTH="100%" ALIGN="CENTER">
    <TR>
        <TD><B>Name:</B></TD>
        <TD><INPUT TYPE="text" NAME="Name" VALUE="" SIZE="65"> </TD>      
    </TR>
    </TABLE>
    <P>
    <INPUT TYPE="SUBMIT" VALUE="Submit">
    </FORM>
    </FONT>
    </BODY>
    </HTML>******************
    HelloWorld.java
    package jservlets;
    import java.io.*;
    import java.util.Date;
    import java.util.*;
    import java.text.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorld extends HttpServlet
       PrintWriter out;
       PrintWriter err; 
       String strName;
    public void displayMessage(HttpServletRequest request, HttpServletResponse response)
          throws Exception
             try
                if (!strName.equals("") && strName != null)
                   out.println("Hello " + strName + "" + "<P>");
                    out.println("Hello World" + "<P>");
                else
                    out.println("Hello World" + "<P>");
            catch (Exception e)
                out.println("Exception: Could not display message." + "<P>");
                err.println (e.getMessage () ) ;
                out.println("<P>");
    public void doPost(HttpServletRequest request, HttpServletResponse response)
               throws ServletException, IOException
          try
               response.setContentType("text/html"); 
               out = response.getWriter();
               err = response.getWriter();
               strName = request.getParameter("Name").trim();
               out.println("<html><head><title>");        
              out.println("</title></head><body>");
               out.println("<FORM");
               out.println("METHOD=POST");
               out.println("ACTION=http://localhost:8080/HelloWorldExample/hello.jsp>");
             out.println("<TABLE ALIGN='RIGHT'>");
             out.println("<TR>");
             out.println("<TD>");          
               out.println("<INPUT TYPE=\"SUBMIT\" VALUE=\"Hello World Page\";>");
               out.println("</INPUT>");
              out.println("</TD>");
             out.println("</TR>");
             out.println("</TABLE>");
             out.println("</FORM>");
             out.println("<BR CLEAR='all'>");
               out.println("<P>");        
               displayMessage(request, response);
               out.close();
             out.println("</body></html>");               
           catch(Throwable e)
              e.printStackTrace();
          public void doGet(HttpServletRequest request, HttpServletResponse response)
             throws ServletException, IOException
             doPost(request, response);
    web.xml
    <servlet>
          <servlet-name>HelloWorld</servlet-name>
          <servlet-class>jservlets.HelloWorld</servlet-class>
    </servlet>  
    <servlet-mapping>
            <servlet-name>HelloWorld</servlet-name>
            <url-pattern>/servlet/HelloWorld</url-pattern>
    </servlet-mapping>      ******************************
    HelloWorld.java can be compiled by using javac.
    Once compiled, HelloWorld.class would be moved to the jservlets folder.
    FYI, coding the above url-pattern results in:
    HTTP Status 404
    The requested resource (/HelloWorldExample/servlet/jservlets.HelloWorld) is not available
    The following url-pattern in the web.xml file permits the servlet to be executed but results in a null pointer exception:
    <servlet-mapping>
            <servlet-name>HelloWorld</servlet-name>
            <url-pattern>/ </url-pattern>
    </servlet-mapping>      **************************************************
    Robin

    This problem was resolved.
    In hello.jsp
    ACTION="servlet/jservlets.HelloWorld">
    was replaced with
    ACTION="servlet/HelloWorld">
    Robin

  • Calling a smart form on click of a button in web dynpro abap

    Hi experts,
    I have a requirement like if I click a button in a view i need ti generate a PDF through smart form.
    Is this possible. If so please tell me the way..
    Thanks & Regards

    Hi Sharma,
    Create Interactive form in your view, create one node say PDF_SOURCE under this one attribute PDF_SOURCE of type XSTRING.
    Bind this to IF form Datasource and pdfsource.
    in your button action write code to call your smartform
    using SSF_FUNCTION_MODULE_NAME
    using FM  CONVERT_OTF and attach_file_to_response
    *convert to pdf
      call function 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
        IMPORTING
          bin_filesize          = lv_bytecount
        TABLES
          otf                   = ls_job_output_info-otfdata
          lines                 = lt_lines
        EXCEPTIONS
          err_conv_not_possible = 1
          err_bad_otf           = 2.
      loop at lt_lines into ls_line.
        lv_string = ls_line.
        export mydata = lv_string to data buffer lv_buffer.
        import mydata to l_xline from data buffer lv_buffer in char-to-hex
        mode.
        concatenate l_pdfstring l_xline into l_pdfstring in byte mode.
      endloop.
      call method cl_wd_runtime_services=>attach_file_to_response
        EXPORTING
          i_filename      = 'ZWTY_PACKINGSLIP'
          i_content       = l_pdfstring
          i_mime_type     = 'BIN'
          i_in_new_window = abap_false
          i_inplace       = abap_false.
    also check this..
    http://abapcodexperiments.wordpress.com/2011/03/20/smartform-pdf-webdynpro-abap/
    Call smartform in web dynpro abap
    Cheers,
    Kris.

  • Syntax for how to call method of one comp in other comp     wd java.

    Let us assume,
    there is method1 in view1 comp1.
    tell me syntax for calling method 1 in view2 comp2
    thanks in advance.
    Edited by: madhu1011 on Nov 9, 2011 11:31 AM

    Hi Madhu,
    This is the situation:
    comp1-> method 1 , view1
    comp2-> view2
    You need to access method1  in view2 of comp2.
    For that, do the following steps:
    1.) First create a method (for eg: method1) in comp1 (under implementation of view1).
            eg: public void method1(){
                    <......some logic...>
    2.)Save the meta data.
    3.) In comp2, you will find an option called used components. In that right click and add the component comp2. (Carefully select comp1 itslef).
    4.)Save the meta data.
    5.) Then go to view2 of comp2 and take implementaion part and right the following logic in wddoinit() (or any other standard or custom method).
    wdThis.wdGetComp2Interface().getMethod("method1"); 
    By this way, we can access the method1 of comp1 in comp2.
    Regards,
    Jithin

  • Security Problem when call EJB in servlet:[Security:090398]Invalid Subject

    Hi guys,
    I have several years experience with Java and EJB developing,but still I cann't explain this problem although I already knew the fix...
    Please,can anyone help me to explain why? Thanks very much!
    Ok,the problem is when I call a remote EJB in one method ,that is everything about EJB is in one method,then everything is ok.But when I just return the
    *remote service object from an helper class's static method, and call the service in servlet ,then I get java.lang.SecurityException: [Security:090398]Invalid Subject: principals=[sundan076],which sundan076 is username login into the web application.*
    The right way, call method directCall(param) ; The wrong way, call  method staticToolCall(final Map param) .
    public class EJBServletClient extends HttpServlet
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              this.doPost(request, response);
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
                   IOException
              try
                   Map<String, String> param = new HashMap<String, String>();
                   param.put("CTS_CUSTOMER_ID", request.getParameter("CTS_CUSTOMER_ID"));
                   param.put("CTS_TASK_ID", request.getParameter("CTS_TASK_ID"));
                   param.put("SERIALNO", request.getParameter("SERIALNO"));
                   param.put("CUSTOMER_SERVICE_UM", request.getParameter("CUSTOMER_SERVICE_UM"));
                   Map result = this.directCall(param);
                   System.out.println(result);
              } catch (Exception e)
                   e.printStackTrace();
                   throw new ServletException(e);
         private Map directCall(Map param) throws Exception
              Context context = null;
              try
                   Properties p = new Properties();
                   p.put(Context.PROVIDER_URL, "t3://10.25.32.13:31256");
                   p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
                   p.put(Context.SECURITY_PRINCIPAL, "username");
                   p.put(Context.SECURITY_CREDENTIALS, "password");
                   context = new InitialContext(p);
                   BizApplyServiceHome home = (BizApplyServiceHome) PortableRemoteObject.narrow(
                             context.lookup("ejb/rcs-css/BizApplyService"), BizApplyServiceHome.class);
                   BizApplyService bizApplyService = home.create();
                   return bizApplyService.modifyApplyCustomerInfo(param);
              } finally
                   if (context != null)
                        context.close();
         private Map staticToolCall(final Map param) throws Exception
              BizApplyService bizApplyService = EJBTool.getBizApplyService();
              return bizApplyService.modifyApplyCustomerInfo(param);
    public class EJBTool
         public static BizApplyService getBizApplyService() throws Exception
              Context context = null;
              try
                   Properties p = new Properties();
                   p.put(Context.PROVIDER_URL, "t3://10.25.32.13:31256");
                   p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
                   p.put(Context.SECURITY_PRINCIPAL, "username");
                   p.put(Context.SECURITY_CREDENTIALS, "password");
                   context = new InitialContext(p);
                   BizApplyServiceHome home = (BizApplyServiceHome) PortableRemoteObject.narrow(
                             context.lookup("ejb/rcs-css/BizApplyService"), BizApplyServiceHome.class);
                   return home.create();
              } finally
                   if (context != null)
                        context.close();
    java.lang.SecurityException: [Security:090398]Invalid Subject: principals=[sundan076]
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
         at com.pingan.rcs.css.biz.service.remote.ejb.bizApplyService_u7jjbk_EOImpl_1032_WLStub.modifyApplyCustomerInfo(Unknown Source)
         at com.pingan.pafax.web.EJBServletClient.staticToolCall(EJBServletClient.java:80)
         at com.pingan.pafax.web.EJBServletClient.doPost(EJBServletClient.java:43)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3594)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.lang.SecurityException: [Security:090398]Invalid Subject: principals=[sundan076]
         at weblogic.security.service.SecurityServiceManager.seal(SecurityServiceManager.java:835)
         at weblogic.security.service.SecurityServiceManager.getSealedSubjectFromWire(SecurityServiceManager.java:524)
         at weblogic.rjvm.MsgAbbrevInputStream.getSubject(MsgAbbrevInputStream.java:315)
         at weblogic.rmi.internal.BasicServerRef.acceptRequest(BasicServerRef.java:875)
         at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:310)
         at weblogic.rmi.cluster.ClusterableServerRef.dispatch(ClusterableServerRef.java:242)
         at weblogic.rjvm.RJVMImpl.dispatchRequest(RJVMImpl.java:1138)
         at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:1020)
         at weblogic.rjvm.ConnectionManagerServer.handleRJVM(ConnectionManagerServer.java:240)
         at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:882)
         at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:453)
         at weblogic.rjvm.t3.MuxableSocketT3.dispatch(MuxableSocketT3.java:322)
         at weblogic.socket.BaseAbstractMuxableSocket.dispatch(BaseAbstractMuxableSocket.java:298)
         at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:915)
         at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:854)
         at weblogic.socket.EPollSocketMuxer.dataReceived(EPollSocketMuxer.java:215)
         at weblogic.socket.EPollSocketMuxer.processSockets(EPollSocketMuxer.java:177)
         at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:42)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
    Edited by: 993478 on 2013-3-12 下午8:40

    I tried your way,it works! Still ,does anyone know why staticToolCall() raised exception?
    By the way,here is the code as you suggested:
    public class EJBServletClient extends HttpServlet
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
                   IOException
              Context context = null;
              try
                   Map<String, String> param = new HashMap<String, String>();
                   param.put("CTS_CUSTOMER_ID", request.getParameter("CTS_CUSTOMER_ID"));
                   param.put("CTS_TASK_ID", request.getParameter("CTS_TASK_ID"));
                   param.put("SERIALNO", request.getParameter("SERIALNO"));
                   param.put("CUSTOMER_SERVICE_UM", request.getParameter("CUSTOMER_SERVICE_UM"));
                   //Map result = this.staticToolCall(param);
                   Properties p = new Properties();
                   p.put(Context.PROVIDER_URL, "t3://10.25.32.13:31256");
                   p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
                   p.put(Context.SECURITY_PRINCIPAL, "username");
                   p.put(Context.SECURITY_CREDENTIALS, "password");
                   context = new InitialContext(p);
                   Map result=EJBTool.modifyApplyCustomerInfo(context, param);
                   System.out.println(result);
              } catch (Exception e)
                   e.printStackTrace();
                   throw new ServletException(e);
              }finally
                   if (context != null)
                        try{context.close();} catch (NamingException e){e.printStackTrace();}
    public class EJBTool
         public static Map modifyApplyCustomerInfo(Context context, Map param) throws Exception
              BizApplyServiceHome home = (BizApplyServiceHome) PortableRemoteObject.narrow(
                        context.lookup("ejb/rcs-css/BizApplyService"), BizApplyServiceHome.class);
              BizApplyService bizApplyService = home.create();
              Map result = bizApplyService.modifyApplyCustomerInfo(param);
              return result;
    }

  • Issue with Capturing Long text using CALL METHOD EDITOR- GET_TEXT_AS_STREAM

    HI Experts,
    Standard Long text is capturing using CALL METHOD EDITOR->GET_TEXT_AS_STREAM
         but not working for Custom Long text – Only changes
    Here is the Issue:
    1)      Created Custom Long text in TAB. --> Good
    2)      Entered few lines in custom Long text  --> Good
             Click on Standard Tab , Leaving Custom tab and Custom Long text-->Good
    4)      In PAI of Custom Tab – Changes captured using CALL METHOD 1 ( See below Code 1)--> Good
    5)      Entered few lines in Standard Long text in Standard Tab -->Good
    6)      Click another Standard Tab
    7)      In PAI of Standard Tab – Changes captured using CALL MEHTOD 2 ( See Below Code 2)-->Good
    8)      Come back to Standard Tab / Standard Long Text , Enter few more lines.
    9)      Change the Tab , IN PAI of Standard Tab/Standard Text , Changes Captured using CALL METHOD2 ( See Below CODE 3) --> Good
    10)   Go to Custom Tab , Custom Long text , Entered few more lines--> Good
    11)   Click on any other tab, Triggered again PAI of Custom tab / Custom Long text using Call Method1 ( See Below Code 4) -->Good triggered PAI same CALL METHOD TEXT_EDITOR1->GET_TEXT_AS_STREAM.
    12)   But additional lines are not captured , saying ZERO LINES in Internal Table and IF_MODIFIED = NO  -->Issues lies here.
    CODE1 ( Custom Long text entry capturing – First Few Lines )
    Custom Long text Entries are stored in LS_OUTTAB-TEXT first time when entered few lines and LV_MOD is 1.
    PAI of Custom tab
    CALL METHOD TEXT_EDITOR1->GET_TEXT_AS_STREAM
            EXPORTING
              ONLY_WHEN_MODIFIED     = CL_GUI_TEXTEDIT=>TRUE
            IMPORTING
              TEXT                                       = LS_OUTTAB-TEXT ( FIlled with Lines entered in custom long text )
              IS_MODIFIED            = LV_MOD ( Value 1 , Modified )
            EXCEPTIONS
              ERROR_DP               = 1
              ERROR_CNTL_CALL_METHOD = 2
              OTHERS                 = 3
    CODE2 ( Standard Long Text Entry Capturing – First Few Lines )
    Standard Long text Entries are stored in SELECTED_TEXT first time when entered few lines and FLAG_MODIFIED is 1.
    PAI of Standard tab
       CALL METHOD EDITOR->GET_TEXT_AS_STREAM
          EXPORTING
            ONLY_WHEN_MODIFIED = YTRUE ( Value 1 , Modified )
          IMPORTING
            TEXT                               = SELECTED_TEXT ( FIlled with Lines entered in standard long text )
            IS_MODIFIED        = FLAG_MODIFIED.
    CODE 3 ( Standard Long Text Entry Capturing – Second time Few Lines )
    Standard Long text Entries are stored in SELECTED_TEXT  second  time when entered few lines and FLAG_MODIFIED is 1.
    PAI of Standard tab
       CALL METHOD EDITOR->GET_TEXT_AS_STREAM
          EXPORTING
            ONLY_WHEN_MODIFIED = YTRUE
          IMPORTING
            TEXT                               = SELECTED_TEXT ( FIlled with Lines entered in standard long text )
            IS_MODIFIED        = FLAG_MODIFIED. ( Value 1 , Modified )
    CODE4 ( Custom Long text entry capturing – Second Time Few Lines )
    Custom Long text Entries are not stored in LS_OUTTAB-TEXT Second Time when entered few lines and LV_MOD is 0.
    PAI of Custom tab
    CALL METHOD TEXT_EDITOR1->GET_TEXT_AS_STREAM
            EXPORTING
              ONLY_WHEN_MODIFIED     = CL_GUI_TEXTEDIT=>TRUE
            IMPORTING
              TEXT                                       = LS_OUTTAB-TEXT  ( ZERO ENTRIES )
              IS_MODIFIED            = LV_MOD   ( NOT MODIFIED Flag )
            EXCEPTIONS
              ERROR_DP               = 1
              ERROR_CNTL_CALL_METHOD = 2
              OTHERS                 = 3
    Can anyone help me out of this.
    With Regards,
    Bala M

    Excellent Eitan,
    Here is what I am trying to Achieve.
    In Create Notification IW21 , They need 5 Long Text in Custom Tab ( Say Tab Name is MBR ).
    TAB1 NOTIFICATION Standard Information , TAB2 REFERENCE OBJ , TAB 3 MalFunction , Breakdown Standard one...... TAB 7 ( Custom Tab ).
    In Custom Tab , I added 5 LONG TEXT ( its 5 WHY Concept ).
    When the User enters data in 5 Long text , it should store long text along with Notification number when save.
    But Notification number will be generated @ the time of SAVE , but before that its just shows as
    %0000000001 ( and Number will be generated 1000065479) at Save.
    How to achive this .
    I did this:
    Added 5 Custom Container. and In PBO / PAI
      PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    IN PBO
       CREATE OBJECT TEXT_EDITOR1 ,    CREATE OBJECT TEXT_EDITOR2,    CREATE OBJECT TEXT_EDITOR3 like wise 5
       CALL METHOD TEXT_EDITOR1->SET_TEXT_AS_R3TABLE ,    CALL METHOD TEXT_EDITOR2->SET_TEXT_AS_R3TABLE .. Like wise 5 , So when the user Click on Custom Tab ( MBR ).
    It give 5 Long text.
    When he click tab1 or tab2 or tab3 .. and again tab MBR , still data is available.
    How to store this data for future retrival ( IW22 or IW23 ) ?
    Its working fine when I enter first time and goes here and there and finall save .
    IN SAVE BADI , I imported the Long text and created Standard Text SO10 with Notification Number with LONG1 , LONG2 .. means 1000065479LONG1 as standard text.
    But not working when I entered first time and go to tab1 and tab2 and then to MBR tab and added few more lines , its not exporting full lines and in IMPORT ( SAVE BADI ) giving ZERO Lines.
    Please help and thanks for your quick response.

Maybe you are looking for

  • Can not Delete Data in SEM-BCS

    Dear Expert, I do the following steps : 1. Created Consolidation groups in workbench ( I was not assigned it to anywhere) 2. Save. 3. Deleted Consol group above. 4. WHen i tried to save, There are errors that said "The data model contains inconsisten

  • Tax break up in line by line for  each item in the repetitive area

    Dear SAP PLD Experts I am facing a problem for generating excise invoice in pld with tax break for each line item . for eg : i have 5 line item in the invoice.  so , i want to show the tax break up for each line item seperately in column wise . slNo-

  • Languages and keyboards

    I recently installed an English version of CS6 indesign. I live in a German speaking country, however, and my keyboard is German.  How can I set myself up to work in English but still be able to use the German keyboard shortcuts??

  • How can i refresh my email accounts

    soemtimes i get emails while im on my macbook pro but for some they dont appear unless its from apple is there a way i can refresh my email accountson my mail application my macbookpro

  • JTEXTAREA COLUMNS RESTRICTIONS

    Hello, I'd like to block a jTextArea and avoid users to introduce more than 5 characters .. how can i do it? thanks