Problem with the "required" attribute in input_text (in 1.0 beta)

Suppose you wanted to display a more meaningfull message instead of the default "Validation Error: Value is required", e.g. "Please enter your e-mail address". Looks like the only way to do this is to write a custom validator. However, if required="true" in the input_text, you will get the default message, if you don't set "required", your custom validator is not called at all.
This is something that needs to be addressed, because it will be very common to want to have meaningfull error messages (I can't imagine somebody will approve a commercial application which will display messages like "Validation Error: Value is required").
As a workaround, I tried setting an error message in the action handler, but I can't seem to get the component from within the bean code. In the action method I have:
FacesContext context = FacesContext.getCurrentInstance();
UIInput component = (UIInput) context.getViewRoot().findComponent("testInput");where testInput is the id of the input_text - findComponent() returns null.
P.S. Btw, I noticed that now in 1.0 the ids look like this id0:testInput which is a really bad choice if you have to write any JavaScript handler, e.g. onClick(), since id0:testInput is not a valid JavaScript variable name. You can still find it by going through all the document.forms[0].elements[n].name and set it up that way, but it's a hassle.

Thanks,
findComponent("formName:inputName")worked fine.
But still, I think that if you have a custom validator
it should be called regardless of whether there is
something in the input or not (or maybe bypass the
default validation if "required" attribute is set, but
there is a custom validator), because that's the only
way you can change the default "Value required"
message using a validator. If you have to check it in
the action method, you might as well do the whole
validation there, which makes validators pointless.The expert group considered this decision carefully, and concluded that the current behavior was the best -- if there is no input data, skip any specified validations -- because of the likelihood for things like null pointer exceptons in validators that are not prepared for this scenario.
One approach to dealing with this if you would prefer different behavior for your own components is to subclass UIInput and override the validate() method to do something different.
Craig

Similar Messages

  • How to manage with the required attribute with the h:selectOneMenu ?

    dear all,
    I have form with some drop down list.
    All have a default value to invite user to select a criteria.
    By submitting my form I have an actionListener method wich check validity of the fields.
    I would like to display a message near the <h:selectOneMenu> to point the attention of the user about selection must be done.
    I try following:
    <h:selectOneMenu  id="idContractNature" required="#{applicationController.requiredContract}" partialSubmit="true" valueChangeListener="#{applicationController.valueChangeContractType}" value="#{applicationBackingInfo.opportunityInfo.contractNatureId}">                          
                   <f:selectItems    id="SlctContractNatureItms" value="#{applicationDefaultDataController.contractNatures}"/>          
    </h:selectOneMenu>
    <h:message for="idContractNature"></h:message>I set the required attribute to true in the actionListener method if the contract id is equal to 0 (my default value)
    But it doesn't work.
    How can i check the validity of the drop down list?
    I set the required attribute to true when the

    thanks but can set null for the value of the default value due to:
    Can't set property 'contractNatureId' of type 'int' on class '....' to value 'null'.
    because it's a list SelectItem with int / string

  • Windows 64Bit Itunes Error : "THERE IS A PROBLEM WITH THE WINDOWS INSTALLER PACKAGE. A PROGRAM REQUIRED FOR THIS INSTALL TO COMPLETE COULD NOT BE RUN CONTACT YOUR SUPPORT PERSONNEL OR PACKAGE VENDOR."

    I have a brand new HP laptop windows 64bit that is having issues installing Itunes 10.6.3. Whenever attempting to install, I get the error message : "THERE IS A PROBLEM WITH THE WINDOWS INSTALLER PACKAGE. A PROGRAM REQUIRED FOR THIS INSTALL TO COMPLETE COULD NOT BE RUN CONTACT YOUR SUPPORT PERSONNEL OR PACKAGE VENDOR." I thought this was an issue with the new version, and attempted to retrieve/install older versions of Itunes and same issue occurs. I have tried other forums and resolution tips from : https://discussions.apple.com/docs/DOC-3551 and nothing still. It appears that apple installs bonjour and nothing else. I have tried extracting the itunes package and installing the executables seperately, but everytime the error stil arises. I cannot repair the apple software update as it cannot install from the error mentioned above. Looking through the logs, it shows error : 1721, problem with windows installer package.Does anyone have any suggestions on what to try?

    There are so many different error and problems peopl are having.
    This is a link to mine
    https://discussions.apple.com/thread/3467825
    I think it has to be something on Apples end.
    Hopefully they fix it soon. Ive used a few GB redownloading and Im going crazy
    hope this settles you a bit

  • HT1926 can't install quicktime or itunes on windows 7 get the error message There is a problem with the windows installer package. A program required for this install to complete could not be run

    please help. Can't install quictime player or itunes on windows 7. Get the error message There is a problem with the windows installer package. A program required for this install to complete could not be run. Have followed all the steps suggested and still no luck.

    thank you for trying to help. I do not have apple software update on my computer. I have tried to install several programs so i could install it but every installation will not finish and rolls back and says no changes were made to my computer so i can't install the update. I even tried to force install as administrator but nothing works. Any help would be greatly appreciated. I have windows 7 64 bit.

  • In the middle of the installation processing, this has appeared: "There is a problem with the windows installer package. A program is required for this install to complete could not be run." my question is, what is that specific program?

    in the middle of the installation processing, this has appeared: "There is a problem with the windows installer package. A program is required for this install to complete could not be run." my question is, what is that specific program?

    Let's try the following user tip with that one:
    "There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows

  • Solution Manager systems RAM requirements - problems with the Java Engine

    Hello,
    I am about to install SAP Solution Manager 7 on a WIndows 2003 Server x64 but I need to know what the RAM requirements are? I have been having problems with the Java Engine starting and it seems to time out, I have heard that this is a very RAM hungry process and it might be why?
    Many thanks for your help in advance,
    Omar

    Hello Omar,
    To size SAP Solution Manager 7.0 EHP1 we recommend to use the SAP Solution Manager Quicksizer Tool at:
    http://service.sap.com/sizing-solman
    Here you find information on how to use the tool, how to collect input data for E2E Scenario Sizing, on SAP E2E RCA Sizing, Introscope Tuning, Wily Enterprise Manager Cluster Setup for E2E RCA Scenario and BI Aggregation Strategy in E2E Scenario.
    Please find more information about installing Solution Manager in:
    http://service.sap.com/instguides -> SAP Solution Manager
    I hope this information helps.
    Thanks,
    Mark

  • I installed Adobe CS6 Design & Web Premium on my Mac Book Pro a few years ago but have repeatedly encountered problems with the programs freezing or not opening properly. It's a Student and Teacher Licensing version so an academic ID is required but I am

    I installed Adobe CS6 Design & Web Premium on my Mac Book Pro a few years ago but have repeatedly encountered problems with the programs freezing or not opening properly. It's a Student and Teacher Licensing version so an academic ID is required but I am no longer a student--can I still reinstall it since my academic ID may no longer be valid?

    Erin Elzo as long as the serial number has been registered under your account at http://www.adobe.com/ then you should be able to continue to utilize the software.  You can find details on how to locate your registered serial number at Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html.

  • Getting error and cannot download itunes.  says there is a problem with the windows installer package. a program required for the install to be complete could not be run.  any ideas?

    getting an error downloading itunes 64bit for windows 7.  says there is a problem with the windows installer package.  a program required for the install to be complete could not be run.  any ideas?  i uninstalled it last night when it would not open.

    Just in case, let's try a standalone AppleSoftwareUpdate.msi install.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe, and select "Extract to iTunesSetup". WinRAR will expand the contents of the file into a folder called "iTunesSetup".
    Go into the folder and doubleclick the AppleSoftwareUpdate.msi to do a standalone ASU install.
    (If it offers you the choice to remove or repair, choose "Remove", and if the uninstall goes through successfully, see if you can reinstall by doubleclicking the AppleSoftwareUpdate.msi again.)
    Does it install (or uninstall and then reinstall) properly for you? If not, what error message do you get? (Precise text, please.)

  • I cant install itnes 10.6.3 on my system(Dell xps 64-bit) , ive tried everything possible by downloading it several times but it keeps telling me 'there is a problem with the windows installer package. A program required 4 dis install to cmplete cant run

    i cant install itnes 10.6.3 on my system(Dell xps 64-bit) , ive tried everything possible by downloading it several times but it keeps telling me 'there is a problem with the windows installer package. A program required 4 this install to complete cannott run. Please contact your service vendor?.. Please what can i do?

    Try the following user tip:
    "There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows

  • Problem with the default selection screen condition

    hi guys,
    I have got some problem with the default screen given by the PNP logical database, P0000 infotype automatically populated according to the condition given in default screen.
    Reg,
    Hariharan

    Don know what u r trying to acheive.
    1) when u have specified PNP in the logical databse field of attributes of program, the SAP wil proivde u default PNP screen and here u can also add ur paramters if u want.
    2) in the program u have to declare like
    INFOTYPES: 0000,0001. "Etc
    for all the infotypes u want to use in the program.
    3) it is the GET PERNR event which wil fil all the p0000 and p0001 (internal tables for al the infotypes declared via INFOTYPES syntax as shown above)
    4) after tht get pernr, u now have data in P tables and u can use it for further reporting.
    5) refer below dummy code -
    REPORT  ZPPL_PREVEMPLOYERS   message-id rp
                                 line-size 250
                                 line-count 65.
    *Program logic :- This Report is used to Download all the Previous
    * Employer (IT0023) records of the employees
    *eject
    *& Tables and Infotypes                                                *
    tables: pernr.
    infotypes: 0000,
               0001,
               0002,
               0023.
    *eject
    *& Constants                                                           *
    constants: c_1(1)       type c               value '1'   ,
               c_3(1)       type c               value '3'   ,
               c_i(1)       type c               value 'I'   ,
               c_x(1)       type c               value 'X'   ,
               c_eq(2)      type c               value 'EQ'  ,
               c_pl03       like p0001-werks     value 'PL03'.
    *eject
    *& Selection-Screen                                                    *
    parameters: p_file  like rlgrap-filename default 'C:TempABC.xls',
                p_test  as checkbox default c_x               .
    *eject
    *& Internal tables                                                     *
    * Internal Table for Output
    data: begin of t_output occurs 0    ,
           pernr like pernr-pernr       ,
           nachn like p0002-nachn       ,
           vorna like p0002-vorna       ,
           orgeh_stext like p1000-stext ,
           plans_stext like p1000-stext ,
           begda like p0023-begda       ,
           endda like p0023-endda       ,
           land1 like p0023-land1       ,
           arbgb like p0023-arbgb       ,
           ort01 like p0023-ort01   .
    data: end of t_output           .
    *eject
    *& Variables                                                           *
    data: o_stext like p1000-stext,
          p_stext like p1000-stext.
    *eject
    *& Initialization                                                      *
    Initialization.
    * Initialize Selection-Screen values
      perform init_selction_screen.
    *eject
    *& AT Selection-screen                                                 *
    at selection-screen .
    * Check if Test run selected, download file name should be entered
      if p_test is initial.  "
        if p_file is initial.
          message e016 with 'Please enter file name'
                            'specifying complete path'.
        endif.
      endif.
    *eject
    *& Start-of Selection                                                  *
    Start-of-selection.
    get pernr.
      clear t_output.
    * Read Infotype 0
      rp-provide-from-last p0000 space pn-begda pn-endda.
      check pnp-sw-found eq c_1.
    * Check if employee is active
      check p0000-stat2 in pnpstat2.      "pernr Active
    * Read Infotype 1
      rp-provide-from-last p0001 space pn-begda pn-endda.
      check pnp-sw-found eq c_1.
    * check if employee belongs to PL03
      check p0001-werks in pnpwerks.  "belongs to PL03
    * Check if emp belongs to Active Group
      check p0001-persg in pnppersg.
    * Read Infotype 2
      rp-provide-from-last p0002 space pn-begda pn-endda.
      check pnp-sw-found eq c_1.
    * Read Org Unit Text.
    CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'
         EXPORTING
              OTYPE                   = 'O'
              objid                   = p0001-orgeh
              begda                   = p0001-begda
              endda                   = p0001-endda
              reference_date          = p0001-begda
         IMPORTING
              object_text             = o_stext
          EXCEPTIONS
              nothing_found           = 1
              wrong_objecttype        = 2
              missing_costcenter_data = 3
              missing_object_id       = 4
              OTHERS                  = 5.
    *Read Position Text.
    CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'
         EXPORTING
              OTYPE                   = 'S'
              objid                   = p0001-plans
              begda                   = p0001-begda
              endda                   = p0001-endda
              reference_date          = p0001-begda
         IMPORTING
              object_text             = p_stext
         EXCEPTIONS
              nothing_found           = 1
              wrong_objecttype        = 2
              missing_costcenter_data = 3
              missing_object_id       = 4
              OTHERS                  = 5.
    * Gather all the required information related to the emp
      move: pernr-pernr to t_output-pernr,
            o_stext to t_output-orgeh_stext,
            p_stext to t_output-plans_stext,
            p0002-nachn to t_output-nachn,
            p0002-vorna to t_output-vorna.
    * Gather previous Employee details
      loop at p0023.
        move-corresponding p0023 to t_output.
        append t_output.
      endloop.
    *eject
    *& End-of Selection                                                    *
    end-of-selection.
      perform print_report.
    * Downlaod the file
      if not t_output[] is initial.
        if p_test eq space.
          perform download_file.
        endif.
      else.
        write: 'No records selected' color col_negative.
      endif.
    *eject
    *& Top-of-page                                                         *
    Top-of-page.
    * Print Header
      perform print_header.
    *eject
    *&      Form  download_file
    * Description :
    FORM download_file .
      DATA: full_file_name    TYPE string,
            z_akt_filesize    TYPE i     .
      full_file_name = p_file.
    *  download table into file on presentation server
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename                = full_file_name
          filetype                = 'DAT'
          NO_AUTH_CHECK           = c_x
          codepage                = '1160'
        IMPORTING
          FILELENGTH              = z_akt_filesize
        CHANGING
          data_tab                = t_output[]
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          not_supported_by_gui    = 22
          error_no_gui            = 23
          OTHERS                  = 24.
      IF  sy-subrc               NE        0.
        MESSAGE e016 WITH 'Download-Error; RC:' sy-subrc.
      ENDIF.
    ENDFORM.                    " download_file
    *eject
    *&      Form  print_report
    *Description:
    FORM print_report .
      data: i       type i,
            w_count type i.
      sort t_output.
    * Print the report
      loop at t_output.
        i = sy-tabix mod 2.
        if i eq 0.
          format color col_normal intensified on.
        else.
          format color col_normal intensified off.
        endif.
        write:/1     t_output-pernr          ,
               10     t_output-vorna(25)     ,
               35    t_output-nachn(25)      ,
               61   t_output-orgeh_stext     ,
               102  t_output-plans_stext     ,
               143  t_output-begda           ,
               154   t_output-endda          ,
               168   t_output-land1          ,
               178   t_output-arbgb(40)      ,
               219   t_output-ort01          ,
               249   space              .
      endloop.
      uline.
      Describe table t_output lines w_count.
      Skip 2.
      Write:/ 'Total No of Records Downloaded: ' color col_total,
              w_count.
    ENDFORM.                    " print_report
    *eject
    *&      Form  print_header
    *Description:
    FORM print_header .
      skip 1.
      Uline.
      format Intensified on color col_heading.
      write:/1   'Pers. #'        ,
             10   'Last Name'     ,
             35   'First Name'    ,
             61   'Org Unit'      ,
             102  'Position'      ,
             143  'Beg Date'      ,
            154   'End Date'      ,
            168   'Cntry Key'     ,
            178   'Prev Employer' ,
            219  'City'           ,
            249   space          .
      format intensified off color off.
      uline.
    ENDFORM.                    " print_header
    *eject
    *&      Form  init_selction_screen
    *Description:
    FORM init_selction_screen .
      refresh: pnpwerks,
               pnppersg,
               pnpstat2.
      clear:   pnpwerks,
               pnppersg,
               pnpstat2.
      pnpwerks-sign   = c_i.
      pnpwerks-option = c_EQ.
      pnpwerks-low    = c_pl03.
      append pnpwerks.
      pnppersg-sign   = c_i.
      pnppersg-option = c_EQ.
      pnppersg-low    = c_1.
      append pnppersg.
      pnpstat2-sign   = c_i.
      pnpstat2-option = c_EQ.
      pnpstat2-low    = c_3.
      append pnpstat2.
    ENDFORM.                    " init_selction_screen

  • Problems with the Proxy Programme--Please help

    Hi All,
    I have written a simple proxy server in the form of a servlet. I changed the proxy config of my browser to connect to this servlet hosted on the default context(http://localhost:8080) of the Tomcat 5.0.25 . Well , this servlet internally connects to the proxy of the corporate LAN . The logic that I have applied is as follows. The servlet gets the request from the client (ie the browser in this case) , extracts the headers and contents from the request, sets them to a new request that it forms and finally send this new request to the proxy. When the proxy responds, the servlet collects the response headers and contents adn writes them in its response. To sum up , this servlet transparently carries the requests and responses between the client(browser) and the corporate LAN proxy. Now the problem is this. Let's say , now I am accessing http://www.google.com.The browser sends a request to my servlet with the following headers as they are extracted by my servlet.
    ProxyServer:::>posting request
    ProxyServer:::>headerValue::> headerName = accept : headerValue=*/*
    ProxyServer:::>headerValue::> headerName = referer : headerValue=http://www.google.com/
    ProxyServer:::>headerValue::> headerName = accept-language : headerValue=en-us
    ProxyServer:::>headerValue::> headerName = proxy-connection : headerValue=Keep-Alive
    ProxyServer:::>headerValue::> headerName = user-agent : headerValue=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; UB1.4_IE6.0_SP1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
    ProxyServer:::>headerValue::> headerName = host : headerValue=www.google.com
    ProxyServer:::>headerValue::> headerName = cookie : headerValue=PREF=ID=1be27c0a74f198ca:TM=1082058853:LM=1082058853:S=bu6ORrygzm8AUkm8
    ProxyServer:::>postRequest
    I set these headers into a new connection opened to the proxy and post a fresh request to the proxy,which, in turn responds with the following headers.
    ProxyServer:::>posted request successfully
    ProxyServer:::>writing response
    ProxyServer:::>writeResponse-->headerName = Proxy-Connection : headerValue = [close]
    ProxyServer:::>writeResponse-->headerName = Content-Length : headerValue = [257]
    ProxyServer:::>writeResponse-->headerName = Date : headerValue = [Tue, 13 Jul 2004 14:01:40 GMT]
    ProxyServer:::>writeResponse-->headerName = Content-Type : headerValue = [text/html]
    ProxyServer:::>writeResponse-->headerName = Server : headerValue = [NetCache appliance (NetApp/5.5R2)]
    ProxyServer:::>writeResponse-->headerName = Proxy-Authenticate : headerValue = [Basic realm="Charlotte - napxyclt2"]
    ProxyServer:::>writeResponse-->headerName = null : headerValue = [HTTP/1.1 407 Proxy Authentication Required]
    ProxyServer:::>writeResponse exiting
    ProxyServer:::>wrote response successfully
    I write these headers back to the client. According to what I was thinking, the client ie the browser would open a new dialog box asking for username/password owing to the presence of the "Proxy-Authenticate " header. But it does not happen that way. Rather the browser stops responsding and displays a blank page. Does anyone know why it happens this way? I am pasting the server prog below for everybody's reference.
    package server.proxy;
    //import all servlet related classes
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.io.*;
    import java.net.*;
    import server.resources.*;
    //My Proxy server --->Currently it is very simplea and relies on
    //other proxy servers of an already connected network.
    public class ProxyServer extends HttpServlet
    //stores the resource bundle
    private ServerResBundle resBundle = null;
    //checks for the mode of operation
    private boolean proxySet = false;
    private String proxy = null;
    //storing the original System out/err etc
    private PrintStream sysOutOrig = null;
    private PrintStream sysErrOrig = null;
    private InputStream sysInOrig = null;
    //initialise certain features that are required later
    public void init() throws ServletException
    try
    //initialise the resource bundle
    this.initResBundle();
    System.out.println("ProxyServer:::>res bundle init");
    //set the mode of operation
    this.setMode();
    System.out.println("ProxyServer:::>mode set");
    //set the system out and err --System.setOut etc
    this.setSystemOutErr();
    System.out.println("ProxyServer:::>in/out/err set");
    }//End try
    catch(Exception e)
    System.out.println("Exception in init..."+(e.getMessage()));
    throw new ServletException(e);
    }//Edn
    catch(Throwable e)
    System.out.println("Irrecoverable Error...");
    throw new ServletException(e);
    }//End
    }//End init
    //method to init the resource bundle;
    private void initResBundle()
    this.resBundle = ServerResBundle.getBundle();
    }//End
    //method to set the mode of the server--proxy or direct
    private void setMode()
    //read the target proxy property from the bundle and
    //if it is set,take that URL
    String temp = (String)(this.resBundle.getResource(ResKeys.PROXY_SERVER));
    if ( (temp != null) && (temp.length() > 0) )
    this.proxySet = true;
    this.proxy = temp;
    temp = null;
    }//End
    }//End
    //method to set the system out and err etc
    private void setSystemOutErr() throws Exception
    //keep a copy of the original system out and error
    this.sysOutOrig = System.out;
    this.sysErrOrig = System.err;
    try
    //read the options adn if they are set, take the values directly
    String newOutStr = (String)(this.resBundle.getResource(ResKeys.SYSTEM_OUT));
    String newErrStr = (String)(this.resBundle.getResource(ResKeys.SYSTEM_ERR));
    if ((newOutStr != null) && (newOutStr.length() > 0))
    System.setOut(new PrintStream(new FileOutputStream(new File(newOutStr),true),true));
    }//End if
    if ((newErrStr != null) && (newErrStr.length() > 0))
    System.setErr(new PrintStream(new FileOutputStream(new File(newErrStr),true),true));
    }//End if
    }//End
    catch(Exception e)
    //restore the stuff
    System.setOut(this.sysOutOrig);
    System.setErr(this.sysErrOrig);
    }//End
    }//End
    //this is where the proxy functionalities will be embedded
    public void service(HttpServletRequest req,HttpServletResponse resp)
    throws ServletException,java.io.IOException
    //conenction URL
    URL target = null;
    //conenction to the remote object
    URLConnection targetConn = null;
    //stores the OOS and the OIS
    ObjectOutputStream oos = null;
    ObjectInputStream ois = null;
    try
    //check for the mode of operation
    if (proxySet)
    URLConnection objects go through two phases: first they are created, then they are connected.
    After being created, and before being connected, various options can be specified
    (e.g., doInput and UseCaches). After connecting, it is an error to try to set them.
    Operations that depend on being connected, like getContentLength, will implicitly perform the connection,
    if necessary.
    //for the URL to the proxy
    target=new URL(this.proxy);
    //conenct to the proxy
    targetConn = target.openConnection();
    //set the details of the connectuon
    targetConn.setDoInput(true);
    targetConn.setDoOutput(true);
    targetConn.setUseCaches(false);
    // If true, this URL is being examined in a context in which it makes sense to allow user interactions such as popping up an authentication dialog. If false, then no user interaction is allowed
    targetConn.setAllowUserInteraction(true);
    //connect to the remote object
    // targetConn.connect();//call this only when all the request properties are set
    System.out.println("ProxyServer:::>posting request");
    //post the received request to the URL
    this.postRequest(targetConn,req);
    System.out.println("ProxyServer:::>posted request successfully");
    System.out.println("ProxyServer:::>writing response");
    //receive the response
    //write the received response to the client
    this.writeResponse(targetConn,resp);
    System.out.println("ProxyServer:::>wrote response successfully");
    }//End if
    else
    //currently this functionality is not supported
    throw new ServletException(
    (String)(this.resBundle.getResource(ResKeys.ERR_FUNC_NOTSUPPORTED)));
    }//End
    }//End try
    catch(Exception e)
    if(e instanceof ServletException)
    throw (ServletException)e;
    }//End
    if (e instanceof IOException)
    throw (IOException)e;
    }//End
    //wrap it up in ServletException
    throw new ServletException(e);
    }//End
    }//End
    //method to write the response back to the client
    private void writeResponse(URLConnection targetConn,HttpServletResponse resp)
    throws ServletException
    //get all the header fields from the response connection and set them to the
    //response of the servlet
    Map headerFields = null;
    Iterator headerFieldEntries = null;
    Map.Entry header = null;
    //stores the input stream to the conn
    BufferedReader brConn = null;
    //stores the writer to the response
    PrintWriter prResp = null;
    //checks if the proxy authentication needed or not
    boolean proxyAuthReqd = false;
    try
    //juste ensuring that the proxy authentication is reset
    proxyAuthReqd = false;
    if( (targetConn != null) && (resp != null) )
    //Returns an unmodifiable Map of the header fields.
    //The Map keys are Strings that represent the response-header field names.
    //Each Map value is an unmodifiable List of Strings that represents the corresponding
    //field values
    headerFields = targetConn.getHeaderFields();
    //Returns a set view of the mappings contained in this map
    Set temp = headerFields.entrySet();
    //Returns an iterator over the elements in this set
    headerFieldEntries = temp.iterator();
    if (headerFieldEntries != null)
    while (headerFieldEntries.hasNext())
    Object tempHeader = headerFieldEntries.next();
    if (tempHeader instanceof Map.Entry)
    header = (Map.Entry)tempHeader;
    Object headerName = header.getKey();
    Object headerValue=header.getValue();
    System.out.println("ProxyServer:::>writeResponse-->headerName = "+headerName+" : headerValue = "+headerValue);
    //do not select the key-value pair if both the key adn the value are null
    if ( ( headerName == null) && (headerValue == null) )
    continue;
    }//Enmd
    if (headerValue != null)
    List headerValList = null;
    if (headerValue instanceof List)
    headerValList = (List)headerValue;
    }//End
    if(headerValList != null)
    for (int i=0;i<headerValList.size();i++)
    Object headerValueStr = headerValList.get(i);
    if (headerValueStr instanceof String)
    //note that the header-key can not be null for addHeader
    //I have made this temporary provision to make the programme work.
    resp.addHeader(( (headerName==null)? ("null_header"+i) :(String)headerName),
    (String)headerValueStr);
    //check if the proxy authentication required or not
    if (((String)headerValueStr).
    indexOf(resp.SC_PROXY_AUTHENTICATION_REQUIRED+"") != -1)
    System.out.println("ProxyServer:::>writeResponse-->proxy auth needed");
    //proxy authentication is needed
    proxyAuthReqd = true;
    }//End
    }//Ednd of
    else if (headerValueStr == null)
    resp.addHeader(( (headerName==null)? null :(String)headerName),
    null);
    }//End
    }//End for
    }//End if
    }//End if
    }//End
    }//End while
    }//End if
    //get the writer to the client
    prResp = resp.getWriter();
    System.out.println("ProxyServer:::>writeResponse-->proxyAuthReqd="+proxyAuthReqd);
    //juste test a simple header
    System.out.println("Proxy-Authenticate = "+(resp.containsHeader("Proxy-Authenticate")));
    //if the proxy asks you for authentication,pass on the same to the client
    //from whom you have received the request.When this flag is true,the connection
    //is closed by the remotehost adn hence any attempt to open in input steram
    //results in an error ie IOException
    if (!proxyAuthReqd)
    //now get the content adn write it to the response too
    brConn = new BufferedReader(new InputStreamReader(
    targetConn.getInputStream()));
    String tempStr = null;
    while ((tempStr = brConn.readLine())!=null)
    prResp.println(tempStr);
    }//End while
    //close the connections
    brConn.close();
    }//End if
    else
    prResp.println("Proxy Authentication needed...");
    }//End
    //close the streams
    prResp.flush();
    prResp.close();
    }//End if
    System.out.println("ProxyServer:::>writeResponse exiting\n");
    }//End try
    catch(Exception e)
    throw new ServletException(e);
    }//End
    }//End
    //method to post request to the internet
    private void postRequest(URLConnection targetConn,HttpServletRequest req)
    throws ServletException
    //extract the header parameters and the body content from the incoming request
    //and set them to the new connection
    Enumeration reqHeaders = null;
    //reads the incoming request's content
    BufferedReader brReqRd = null;
    PrintWriter prResWt = null;
    //stores temp header names and values
    String headerName = null;
    String headerValue = null;
    try
    if( (targetConn != null) && (req != null) )
    reqHeaders = req.getHeaderNames();
    //extract a header adn set it to the new connection
    while (reqHeaders.hasMoreElements())
    headerName = (String)(reqHeaders.nextElement());
    headerValue = req.getHeader(headerName);
    targetConn.setRequestProperty(headerName,headerValue);
    System.out.println("ProxyServer:::>headerValue::> headerName = "+headerName+" : headerValue="+headerValue);
    }//End
    System.out.println("ProxyServer:::>postRequest\n");
    //establis the actual connection
    //calling this method bfore the above loop results in IllegalStateException
    targetConn.connect();
    //NOTE : try reading from and writing into OIS and OOS respectively
    //now read the contents and write them to the connection
    // brReqRd = req.getReader(); //this hangs for some reason
    brReqRd = new BufferedReader(new InputStreamReader(req.getInputStream()));
    System.out.println("Got the reader..brReqRd = "+brReqRd);
    if (brReqRd != null)
    String temp = null;
    //establish the printwriter
    // prResWt = new PrintWriter(targetConn.getOutputStream(),true);
    prResWt = new PrintWriter(targetConn.getOutputStream());
    System.out.println("trying to read in a loop from brReqRd.. ready="+(brReqRd.ready()));
    while( (brReqRd.ready()) && ((temp=brReqRd.readLine()) != null) )
    System.out.println("In while::>temp = "+temp);
    prResWt.println(temp);
    }//Emd while
    //close the streams adn go back
    brReqRd.close();
    prResWt.flush();
    prResWt.close();
    }//End
    }//End outer if
    System.out.println("ProxyServer:::>postRequest exiting\n");
    }//End try
    catch(Exception e)
    throw new ServletException(e);
    }//End
    }//End
    }//End

    Hi serlank ,
    Thanks for your reply. Well , I initially I thought of not pasting the code,as it was too long. But I could not help it,as I thought I must show in code what I exactly meant. That's why I followed a description of my problem with the code. You could probably have copied the code and pasted it in one of your favourite editors to take a look at it. Did you,by any chance, try to read it on the browser? And as regards reposting the same message, I can say that I did it as I felt the subject was not quite appropriate in the first posting and I was not sure as to how I could delete/alter the posting. I am not asking for a code-fix,but some suggestions from some one who might ever have come across such a thing.Anyway, lemme know if you have any idea on it. Thanks...

  • Problem with the hierarchial fields in a Purchase order xml report

    Hi,
    I am having a problem with the hierarchy problem. We are populating attribute 15 of a PO header. some times it can be null. FYI, we are using 11.5.10 instance where oracle supports direct PO template rather than having a rdf file.
    And now in the xml report, if attribute15 of po header is not null then it is fine.
    But if attribute15 is null, then the template is picking from the next available attribute15 that is from the po lines. As the line level group of "LINES" is between the "PO_DATA" (header group), hence the template is checking for next available attribute15.
    Can any one please suggest how to design the template where we can make the template to check only for that tag at the header level group rather than the line level group tag?
    Thank You in advance.
    Regards,
    Srinivas.

    Hi
    Incase you want to transfer attachements from SRM to R/3, then you try implementing the BADI in SRM side. The BADI which will help in this case is
    <b>BBP_CREATE_PO_BACK</b> BADI.
    <b>Please read the standard SAP documentation of this BADI using SE18 Transaction, before making any code changes.</b>
    <u>Few Important SAP OSS notes to refer in this case -></u>
    Note 989184 - Transferred shopping cart with internal attachments
    Note 550071 - FAQ: EBP - Shopping Cart
    Note 916347 - Transfer shopping cart with internal attachments
    Note 1001130 - FAQ - Attachment questions (Buyside)
    <u>Few useful links -></u>
    <b>http://help.sap.com/saphelp_srm50/helpdata/en/49/b32640632cea01e10000000a155106/frameset.htm
    Re: Attachments to backend
    Re: Document Attachments in Shopping Cart
    Re: Attachment in SRM
    Re: SRM Documents and Attachments
    Re: Limit in Attachments of an item in Shopping Cart
    Re: return delivery text from material document is not passed to SUS
    </b>
    Do let me know, incase you face any problems.
    Regards
    - Atul

  • I am having email problems with the new Lion.  stmp, imap, etc. I have looked up google info and It is confusing when it comes to TS, SSL also, please explain how to set it up so my email goes out and comes in securely.  Help

    I am having email problems with the new Mountain Lion.  stmp, imap, etc. I have looked up google info and It is confusing when it comes to TS, SSL also, please explain how to set it up so my email goes out and comes in securely.  Help
    Incoming Mail (IMAP) Server - requires SSL:
    imap.gmail.com
    Use SSL: Yes
    Port: 993
    Outgoing Mail (SMTP) Server - requires TLS:
    smtp.gmail.com (use authentication)
    Use Authentication: Yes
    Use STARTTLS: Yes (some clients call this SSL)
    Port: 465 or 587
    Account Name:
    your full email address (including @gmail.com) Google Apps users, please enter username@your_domain.com
    Email Address:
    your full Gmail email address ([email protected]) Google Apps users, please enter username@your_domain.com
    Password:
    your Gmail password
    The Quick Answer
    Follow the instructions below to set up IMAP1 access in most email clients.
    Google Apps users, please follow the default instructions unless otherwise noted, replacing 'your_domain.com' with your actual domain2 name.
    this is all greek to me. WHAT IS STARTTLS? On the first page of Apple set up there is a TLS certificate and it is marked NONE- should I change it to the long APPLE CERT option?  The next page under ADVANCED: THERE IS A BOX SSL MARKED.  Then IMAP Path Prefix - I put stmp.gmail.com.. is that right?  Port 993 can  use this one? as 456 doesn't work and 587 said it wasn't safe.  Under AUTHENTICATION I used PASSWORD.  Should I have used external client cert TLS?
    Please help me set this up securely. Thanks

    Apple - Support - Mail Setup Assistant

  • I created one apple I'd when I started using the iPad.  After some days, I had to create a new apple I'd as there was some problem with the first one. Now at some places still my old apple I'd is appearing.  Pls adv how I change this to my new apple Id.

    I created one apple I'd when I started using the iPad.  After some days, I had to create a new apple id
    as there was some problem with the first one. Now at some places still my old apple Id is appearing.  Pls adv how I change this to my new apple Id.

    Anything you downloaded with the first Apple Id will forever be tied to it, and will always require it to update.
    The question here is, why did you think you needed to create a new Apple ID? What was the problem with the first one?
    To get rid of th old one, you'll need to delete everything you downloaded with it, and then sign out of the ID in several places around the iPad. 
    Go to Settings->iTunes & App Stores->Apple ID->Sign out.
    Repeat the process, for Facetime, Messages, Mail and any other App you need to sign out of.

  • Problems with the Fios 20/5 connection speed in my area dropping down to less than 3mbs.

    I have written out a flyer that I plan to go door to door with. Since I am under contract with Verizon, I am forced to honor my side of the contract. Even if they are allowed to make me pay for a service that I am not completely getting. I am very displeased and as soon as my contract is up, I will change back to My local cable companies all in one that does not require a contract and has no issue such as the one I am having.
    Do you have Verizon Fios Internet?
    Are you on the 20/5 connection?
    If so, you may not be getting the speed you are paying for. I am on a 20/5 connection and when my computer is on for longer than an hour the internet download speed with Verizon Fios starts to slow down until it is below 3mbs. It takes about 24 hours to get down to 3mbs but only about an hour or two to get down to about 6-7mbs when I am paying for 20mbs…
    I have 3 computers in my home that have Windows Vista, Windows XP home edition and Windows Media Edition 2005. All of the computers run into this same exact issue, I have tried every setting I could think of with my 24 years of computer technical experience. I finally took one machine with Windows XP and ran a full format on the hard drive and reinstalled a fresh Windows Xp Operating system onto the hard drive so it is a bare bones OS. This way there is no other software on the machine that could possibly be causing the problem and found that when I connected online through Verizon Fios the machine still ran into the same exact issue. This proves to me that the issue is not on any of my machines.
    Now all of this time my buddy that lives 1.2 miles away from my house has been having the same issue with three computers at his home also. He has Windows Vista on two machines and Windows XP Pro on one.
    When I concluded that it was a Verizon Fios issue, after a few months of trying to get by, researching, diagnosing and losing much information in order to verify it was on Verizon’s side, I contacted technical support at Verizon’s online website. The agent and I went through the regular procedure that anyone would have to go through and I patiently explained what I had done to try to diagnose the issue. The agent came to the conclusion that he could not figure out the problem so he guessed that the Verizon router/modem may be the issue and told me he would send me a new one by mail.
    I received the new Verizon router/modem, installed it and had to call to have it activated. Afterward it still had the same exact issue as the prior router/modem. So now we know it’s not my computers, it’s not the router/modem. My Verizon router/modem is connected right at the Optical Network Terminal (ONT), which is the box that connects the fiber-optics to your home, usually just inside or outside your garage wall. Mine is just outside…
    From here my buddy, who has been having this problem also the entire time, called the local office of Verizon Fios and an installer was setup to come over to his home and trouble shoot the issue. My buddy called me and told me when the installer was headed to his home and I met him at his home to see what the installer found and in hope that my issue would be fixed at the same time. The installer went through the system at his house and was frustrated about not finding the reason for the issue and ready to leave without fixing anything. I simply asked that he stay long enough to see the issue present itself within an hour-hour and a half.
    His laptop itself already showed the speed drop from 20mbs to between 16-17mbs, it was on its way down. He basically told us something that online tech support already stated to me, it is extremely difficult to prove it is on Verizon’s side. In other words it is extremely difficult to prove it, in a way that will convince Verizon to check its own servers, routers and software updates to their own systems. The installer, good guy, couldn’t/wouldn’t stay but we did convince him not to simply drop the issue. He called shop and they sent another installer out to take over the issue.
    The new installer, great guy, got up to speed on what was already done at my buddies home. The first installer, checked and replaced the Verizon router/modem, checked the wiring and splitters. Basically went through the entire system up to the Optical Network Terminal (ONT), the box that connects the fiber-optics to your home. He pulled and replaced the Optical Network Terminal (ONT), thinking that perhaps the unit was compromised. While he was doing this job a tech was called and asked to stop by for assistance with the issue. The tech checked the computers inside and tried to do some settings that the main office informed him to try. I explained to the tech that the same issue was happening at my house, that I went through every setting I could think of and find online to help alleviate the issue. After some shop talk about what I had tried, including the full format and reinstall of the operating system on one of my machines, he just as I came to the conclusion that it couldn’t be with the computers and since everything that had to do with the Verizon Fios system from the street to the end-user computer had been checked, verified and/or replaced, the issue had to be coming from Verizon’s main office.
    The installer had already checked the main at the road that has the 3x2 green service cover on it by the side walk. Everything was in good working order. The tech called the main office to see if my buddy and I were on the same hub, basically a big splitter that continues the service from the main office to the homes, we were not. So that was ruled out…
    My understanding of the system ends there. The only other components I know of are the Main branch’s routers, servers and software.
    Verizon had a new connection speed added to their system, 25/15 about the same time our issue began. So I am guessing that when they updated the system to include this new connection speed they corrupted the software for the 20/5 connection.
    We have been waiting to hear from the tech that was at my buddy’s house, to see if the issue will be dealt with. My buddy has called him a couple of times and he has mentioned that he is trying to get it addressed and to call back if we hadn’t heard from him. He remembered who he and I were and what the issue was, so I believe he is taking it seriously. How far he can move the issue is beyond me…
    I want to add that my buddy and I have been customers with the all in one package from Verizon Fios since their services have moved into our area, about a year and a half… It has only been since about June that this issue has presented itself, before then we were on 7th heaven with the speeds. We couldn’t have been more than happy with the services.
    This issue has caused that to all go afoul, not only do the speeds get down to less than 3mbs but the speed is not smooth at all. Rather the 3mbs speed is stop and go, freezing in between at times, very choppy. Barely usable at times, unless you restart the computers and start over.
    We are hoping that anyone with Verizon Fios Internet Services will keep an eye on their speeds by going to http://speedtest.net and doing tests to verify they are getting the speeds they are paying Verizon for.
    This is what it will take for Verizon to take this issue seriously is to gather everyone on the system that may be having the same issue. I believe it is everyone that is within the 1.2 miles from my house to my buddy’s and will distribute flyers to each and every house in between.
    If you find that your speed is not as fast as it should be please contact me and I will add you to the list, this way we can see exactly how far this problem covers and perhaps it will also help to show a pattern and understanding as to why the issue is present in the first place.
    My contact information,
    I have left this out here, you can contact me on these forums...

    Actually what this came down to was an issue between Windows Vista and an Ethernet Card on one of the machines in each of our local networks.
    Even though our two machines are 6 years apart, we both have the same ethernet adapter on our main desktops. A RealTek RTL8139/810x Family Fast Ethernet Nic. It seems that the adapter does not work at the 20mbs download speeds with Vista. For some reason the adapter does not shut down when the computer does? I don't understand why but it doesn't, it keeps the connection alive. I removed the ethernet cable and pulled the power cable and had my two other computers still connected to the network and found that the issue was resolved. The way I found out was that I used the connections on my main computer to hook up one I had laying around and through further testing found the problem no longer existed...
    Then I realized that my buddy and I installed Windows Vista at about the same time, a couple of months ago. Funny how you can forget an important detail like that. Then I remembered that he had the same identical ethernet adapter as I did, I had noticed that while trouble shooting his computer at his home but didn't think it was important at the time. Until the issue was narrowed down to the adapter, then it all seemed to all fall into line.
    Quite humbling... In the end, anyone who has Windows Vista and this NIC probably will have problems with the 20mbs download speed of the computers on their own networks. I tried the latest Vista driver from RealTek and also tried to roll back the driver, with no success....
    Back at the beginning when we first had fios installed in our homes there wasn't an issue when we had the 10/2 speeds and had Vista. Then we decided to change from Vista to XP because we both were having issues as to what programs you could use and which you could not, shortly after having fios installed. Then when verizon upgraded us to 20/5 we were amazed at the speed and still had no issue because we had XP on our main computers with the RealTek adapters...
    We reinstalled Vista because it seemed like we were having more issues with XP by getting hit with Antivirus2008 and its variants and thought it time for a change back...
    It didn't really hit us that Vista could be the culprit because we both have a laptop in our networks that have had Vista on them from the get go when there were no issues... We also didn't notice just how bad it was right away and over time kind of left the Vista install out of the equation.
    Just strange that one computer can effect all the other computers on the network, even when it is shut down...
    I allowed the other two computers to run 24hours and the issue did not present itself, when I added the main computer with the RealTek adapter back to the mix it reappeared. The Realtek adapter is the only real common denominator between his machine and mine.
    So now we have three choices,
    We can go back to Windows XP.
    We can buy a new NIC or a wireless card to replace the RealTek...
    Hopefully this post will help anyone else who runs into this problem, it has been very frustrating to say the least...
    Thanks to everyone for their help and I apologize for complaining about verizon when it was not a verizon issue. I came to the conclusion that the only part verizon really played was upgrading us to a 20/5 tier which I am thankful for...
    Would be nice if this card was on a list that Verizon support could use to troubleshoot , diagnose or eliminate for future support issues.
    Message Edited by keiser0619 on 08-06-2009 03:58 PM

Maybe you are looking for

  • Third Party Billing Plan Invoice problem

    I have an issue in regards to using milestone billing with a third party order.. We currently use third party ordering to ship goods direct to our customers from our parent company in France. This process works well. I know have a scenario where our

  • 3D pie chart in a report

    Hi all, I need to add a 3D pie chart in a report, and I don´t find it in the Chart Wizard. Anyone knows if is it possible to do this? Thanks in advance.

  • Embedded Google search on our website is not showing results. Windows 8, 64 bit, Firefox 30

    We have Google Search embedded in our website. It was brought to my attention by one of our employees that Firefox is not showing the results of the search after the search button is clicked. The issue seems to be only confined to Firefox. Tested the

  • Using Flashback Database on 11g

    hi everyone, My 11g db is size 50 GB on a very strong Windows server. No performance problems whatsoever. If I enable Flashback Database logging am I likely to notice any performance degradation? The data is not really heaviily changed. What about di

  • E5 became slow after update and some application d...

    hi again  to every 1 who didnt see my last 2 post i will tell u the story  i have e5 phone  with software V042.007 i updated it to V042.014 then i found its slow and some application (clock is one of these applications) doesnt work  i tried every thi