How to use protected method in jsp code

Could anyone tell me how to use protected method in jsp code ...
I declare a Calendar class , and I want to use the isTimeSet method ,
But if I write the code as follows ..
========================================================
<%
Calendar create_date = Calendar.getInstance();
if (create_date.isTimeSet) System.out.println("true");
%>
============================================================
when I run this jsp , it appears the error wirtten "isTimeSet has protected access in java.util.Calendar"

The only way to access a protected variable is to subclass.
MyCalendar extends Calendar
but I doubt you need to do this. If you only want to tell if a Calendar object has a time associated with it, try using
cal.isSet( Calendar.HOUR );

Similar Messages

  • How to use protected method of a class in application

    Hi,
      will u please tell me how to use protected method of class in application. (class:cl_gui_textcontrol, method:limit_text)
    Thanks in advance,
    Praba.

    Hi Prabha,
    You can set the maximum number of characters in a textedit control in the CREATE OBJECT statement itself.
    Just see the first parameter in the method . I mean MAX_NUMBER_CHARS. Just set that value to the required number.
    Eg:
    data: edit type ref to CL_GUI_TEXTEDIT.
    create object edit
      exporting
        MAX_NUMBER_CHARS       = 10
       STYLE                  = 0
       WORDWRAP_MODE          = WORDWRAP_AT_WINDOWBORDER
       WORDWRAP_POSITION      = -1
       WORDWRAP_TO_LINEBREAK_MODE = FALSE
       FILEDROP_MODE          = DROPFILE_EVENT_OFF
        parent                 = OBJ_CUSTOM_CONTAINER
       LIFETIME               =
       NAME                   =
      EXCEPTIONS
        ERROR_CNTL_CREATE      = 1
        ERROR_CNTL_INIT        = 2
        ERROR_CNTL_LINK        = 3
        ERROR_DP_CREATE        = 4
        GUI_TYPE_NOT_SUPPORTED = 5
        others                 = 6
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    In this case, the max: number of characters will be set to 10.
    I hope your query is solved.
    Regards,
    SP.

  • Not sure how to use protected method in arraylisy

    Hi,
    Im wondering how to use the removeRange method in java arraylist, its a protected method which returns void.
    http://java.sun.com/j2se/1.3/docs/api/java/util/ArrayList.html#removeRange(int,%20int)
    So if my class extends Arraylist i should be able to call the method but the compiler states that it still has protected access in arraylist. Does this mean im still overriding the method in arraylist ? A little explanation of whats happeneing would be appreciated as much as an answer
    thanks

    In this codefinal class myClass extends java.util.ArrayList {
        private ArrayList array = new ArrayList();
        public myClass(ArrayList ary){
            for(int i=0;i<7;i++) {
                array.add(ary.get(i));
            ary.removeRange(0,7)
    }You are defining a class called myClass which extends ArrayList.
    You have a member variable called array which is an ArrayList
    You have a constructor which takes a parameter called ary which is an ArrayList
    Since ary is an ArrayList, you cannot call it's removeRange() method unless myClass is in the java.util package. Do not put your class in the java.util package.
    It seems like what you want to do is to move the items in one ArrayList to another ArrayList rather than copying them. I wrote a program to do this. Here it isimport java.util.*;
    public class Test3 {
      public static void main(String[] args) {
        MyClass myClass = new MyClass();
        for (int i=0; i<5; i++) myClass.add("Item-"+i);
        System.out.println("------ myClass loaded -------");
        for (int i=0; i<myClass.size(); i++) System.out.println(myClass.get(i));
        MyClass newClass = new MyClass(myClass);
        System.out.println("------ newClass created -------");
        for (int i=0; i<newClass.size(); i++) System.out.println(newClass.get(i));
        System.out.println("------ myClass now contains -------");
        for (int i=0; i<myClass.size(); i++) System.out.println(myClass.get(i));
    class MyClass extends java.util.ArrayList {
        public MyClass() {}
        public MyClass(MyClass ary){
            for(int i=0;i<ary.size();i++) add(ary.get(i));
            ary.removeRange(0,ary.size());
    }You should notice now that I don't create an ArrayList anywhere. Everything is a MyClass. By the way, class names are normally capitalized, variable names are not. Hence this line
    MyClass myClass = new MyClass();
    In the code above I create an empty MyClass and then populate it with 5 items and then print that list. Then I create a new MyClass using the constructor which takes a MyClass parameter. This copies the items from the parameter list into the newly created MyClass (which is an ArrayList) and then removes the items from the MyClass passed as a parameter. Back in the main() method, I then print the contents of the two MyClass objects.
    One thing which may be a little confusing is this line.
    for(int i=0;i<ary.size();i++) add(ary.get(i));
    the add() call doesn't refer to anything. What it really refers to is the newly created MyClass object which this constructor is building. This newly created object is the 'this' object. So the line above could be rewritten as
    for(int i=0;i<ary.size();i++) this.add(ary.get(i));
    Hopefully this helps a little. The problems you seem to be having are associated with object oriented concepts. You might try reading this
    http://sepwww.stanford.edu/sep/josman/oop/oop1.htm

  • How to use enviroment variables in JSP code?

    I�m developing a web server with JSP�s, and I need to move the application to others computers. I need to access to a directory, but I don�t know it because the user can install the Application in the directory he wants. So I need to access to that directory in the JSP code.
    The directory is "C:\Program Files\....\tomcat\webapps\ROOT\upload". I have the CATALINA_HOME enviroment variable defiened as "C:\Program Files\....\tomcat\", so I need to use something like "CATALINAHOME\\webapps\upload\", but I don�t know how to mekr the JSP code to understand the enviroment variable CATALINA_HOME.
    I�ve tried with %CATALINA_HOME%, but the Tomcat server doesn�t recognize it. How can I access to that directory?
    Thanks (Sorry about my english)

    My JSP�s are in: %CATALINA_HOME%\webapps\ROOT\
    I wan�t to access to %CATALINA_HOME%\webapps\ROOT\upload\
    My JSP code:
    <% ...
    String DPATH = "C:\\Program Files\\JBuilder7\\jakarta-tomcat-4.0.3\\webapps\\ROOT\\upload\\";
    File newfile = null;
    newfile = new File(DPATH+filename);
    %>
    I want the JSP to locate the directory \webapps\ROOT\upload\ without knowing the complete route "c:\Program Files\...", because I have the enviroment variable CATALINA_HOME with the value "C:\Program Files\JBuilder7\jakarta-tomcat-4.0.3\". SO the user of the aplication only has to set the CATALINA_HOME variable and the aplication should access the upload directory throught the CATALINA_HOME variable.
    I can�t explain it better. Sorry.

  • I am using NetbeansIDE 5.5.1 In this, How to use java methods in xsl code ?

    Hi everybody,
    I am using Netbeans IDE 5.5.1, In that i am trying to call java methods in XSL code?
    Can anyone help me to provide the solution for this ????
    Note:
    I wrote simple java class method to change the case of given input string.
    Also i compiled that class.
    Now i need to know, where do i put that compiled class file or the source java file, to run my xsl code......
    Please reply soon..
    Thanks in advance....
    regards,
    Selva

    Jim, that sounds like a good hypothesis. Yes, I am using smart previews. I have my originals on an external drive which is connected. Still, LR can not find them. Do you know how to tell LR where to find the originals? I would like LR to identify the source automatically: if external drive is connected LR should show "original and smart preview" not only "smart preview". Thanks for your help.

  • How to use protected method of a particular class described in API

    I read in some forum that for accessing protected method reflcetion should be used. If I'm not wrong then how can I use reflection to access such methods and if reflection isn't the only way then what is another alternative. Please help me...
    regards,
    Jay

    I read in some forum that for accessing protected
    method reflcetion should be used. If I'm not wrong
    then how can I use reflection to access such methods
    and if reflection isn't the only way then what is
    another alternative. Please help me...Two ways:
    - either extend that class
    - or don't use it at all
    If you use reflection, you're very likely to break something. And not only the design. Remember that the method is supposed to be inaccessible for outside classes.

  • How to use getContent() method in custom JSP Provider to display a HTML Pag

    Hi,
    If anybody knows how to use getContent() method to use in custom jsp providers (developed by ourselves) so that it can be used to retrieve a jsp page (a simple html page) ..
    I want the code in the provider java file to for the getContent method...
    Pls. get back to me asap....if any body has implemented a custom jsp provider...as it's urgent...
    I have alreday placed the JSP file in the directory structure /etc/opt/SUNWps/desktop/default/channel_dir..But still the jsp is not being displayed..
    Pls get me the getContent() method code to retrive the JSP file..
    satyabrata

    Hi,
    You don't have to do anything in the custom JSPProvider's getContent method except the call {  return super.getContent(request,response); } . If all you want is just to show your jsp, then create a channel from the default JSPProvider, and edit the property contentPage of that channel from samplecontent.jsp to your jsp name, save the changes and login again. You should see your JSP.
    Sanjeev.

  • Problems using GET method in JSP

    Hi,
    I had some problems using GET method in JSP.
    I'm using Apache web server 1.3 and Tomcat 3.3.1 in windows 2000.
    And I'm using language English and Korean.
    When I send messages using POST method, all is good
    But when I send message using GET method, English is good, but Korean is not good.
    I tried to encode using
    URLEncode.encode(str, "UTF-8")
    and decoding it using
    URLDecode.decode(request.getParameter(tag), "UTF-8")
    but it didn't work.
    How can I receive request including Korean using GET method in JSP?
    If anyone have solutions, please let me know.
    thanks.

    Hi,
    I had some problems using GET method in JSP.
    I'm using Apache web server 1.3 and Tomcat 3.3.1 in
    windows 2000.
    And I'm using language English and Korean.
    When I send messages using POST method, all is good
    But when I send message using GET method, English is
    good, but Korean is not good.
    I tried to encode using
    URLEncode.encode(str, "UTF-8")
    and decoding it using
    URLDecode.decode(request.getParameter(tag), "UTF-8")
    but it didn't work.
    How can I receive request including Korean using GET
    method in JSP?
    If anyone have solutions, please let me know.
    thanks.This problem appears, when one use UTF-16 encoding in JSP - am I right?
    If so there are two solutions:
    1) Temporary: Use "UTF-8" - or any other 8 bit encoding scheme and
    encode Korean symbols with "&1234;" kind of escapes - though it
    may not work
    2) Absolute: get my piece of code, which I have managed to write
    just a month ago resolving absolutely similar problem with UTF-16
    in code using Chinese/Russian/English encodings
    But I wouldn't say that it's costs 10 DDs :) - it's much more
    expensive... So try 1st variant if it wouldn't help - let me know.
    I'll figure :)
    Paul

  • How to access java method in JSP

    Hi all,
    I need to access java class (abstract portal component) method doContent() in a JSP which is under PORTAL-INF/jsp folder.
    I did
    <%@ page import = "com.mycompany.Aclass" %>
    <%com.mycompany.Aclass a = new com.mycompany.Aclass (); %>
    Aclass is coming as autofill/prepopulated with cntrl+space
    Till this time, it is working. no errors. But when I do
    a.
    a. (a dot) no methods are populating (autofill..cntrl+space) or If I forcebly add method a.doContent(req,res)... at runtime its giving error.
    It's not only with doContent method... Its with any simple methods in that class or any other class.
    (Other than doContent method in the APC java class are prepopulating/autofilling but giving error in runtime)
    Can anyone help me... how to access java method in JSP.
    I already gone through many SDN forum post... and implemented too---but no use I refered below forum thread
    Retrieve values from Java class to JSP
    URGENT! How to call a java class from JSP.
    Calling a java method from jsp file -
    this thread is same as my issue
    Thanks,
    PradeeP

    1st. The classes must be in packages. 2nd, the package that they are in must be under the WEB-INF/classes directory. 3rd Look on google and/or this site for web application deployment

  • How to use session object in jsp

    hi all
    marry christmas
    can anyone plz tell me how to use session obect in jsp
    rachna
    Message was edited by:
    rachna_arora82

    hi rachna,
    JSP has a default(implicit) session object...... use the getSession(true) method on the session object and then going u can either get or set attributes depending on the requirement
    That was in general and now with the issue u have got..... what u can do is that the u can create session for every user who logs in and when he/she tries to login again then u can probably check for the existing session object in the JSP and perform the logic as required..... any clarifications plzzzzzzz let me know
    Thanks n Regards
    Naveen M
    Message was edited by:
    Novice_inJAVA
    Message was edited by:
    Novice_inJAVA

  • How to use  SSL Technology in JSP.

    Can anybody Tell me that How to use SSL Technology in JSP ?
    I am using Apache Tomcat 5.0.28 Server.
    How to configure the Tomcat server so that it will access any web application supported by Tomcat via SSL ?
    Thank you very much in advance.

    The JSP does not need to know that the request is coming over SSL. If the application must be over SSL, but the server also allows non-SSL communication, then, like I said, you need to build in a Filter that will check if the incoming request is an https or http request and redirect to the https url if the request was http. And you can do that using the method listed in the previous post. As far as setting up the SSL certificate for Tomcat to use, refer to the Tomcat Documentation that comes with the server. Other than those two things, you don't need to know anything else about SSL inorder to run an SSL application through a Tomcat server (or any other enterprise server either, for that matter), but do an internet search for SSL and maybe one or two other keywords that apply to your situation and you should find plenty that will help.

  • How to Use Exec function in Java Code

    How to Use Exec method
    I want to Execute command
    net Start "some service"
    using exec method of runtime class
    or i use some other way if suggest

    Assuming you have read http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html#exec(java.lang.String) already, I can only suggest to be more specific in what your problems are. If you are after just some example code, then download ftp://ftp.ebi.ac.uk/pub/software/textmining/monq/monq.tar.gz and have a look at the source code of monq.stuff.Exec. It does all those things which are necessary to keep track of a Process after it was created with exec.
    Harald.
    BioMed Information Extraction: http://www.ebi.ac.uk/Rebholz-srv/whatizit

  • How to use the method "getChildrenRemoved()" declared in ElementChange?

    How to use the method "getChildrenRemoved()" declared in DocumentEvent.ElementChange?

    I have tried to use it,but the code below alway say "Yes"....
    I really have no ideas about why ec is always a null.
    public void removeUpdate(DocumentEvent ee) {
           DocumentEvent.ElementChange ec = ee.getChange(doc.getDefaultRootElement());
           if(ec == null)
              System.out.println("Yes");
                     }

  • How to use this method in JSTL?help me please!

    I know I can use "<C:set >" like as
    <c:set var="clabel3" value="${portalCustomizeBean.portalPage}"/> ,
    but now I want to use one method of portalCustomizeBean object not a attribute of it !!!!!
    who would tell me how to use?
    this is wrong in my code:
    <c:set var="clabel" value="${portalCustomizeBean.currentPageLabel}"/>
    <c:set var="clabel3" value="${portalCustomizeBean.toEntitiesExceptSpaceEscape(clabel)}"/>
    but how to use "toEntitiesExceptSpaceEscape" method in JSTL?????

    Why can't you just assign the method's return value to a variable and then print that? A bit of scriptlet code will do the trick. (As much as we all hate to use scriptlet code.)
    I believe you'll be able to do what you want in the 1.1 standard JSTL, but for now this will suffice. - MOD

  • How to use addPasswordToPasswordHistory method

    Hi
    Can some one please tell me how to use the method addPasswordToPasswordHistory from the class WSUser.I have a requirement to add user password to password history whenever user changes his password through my custom password change workflow.Custom workflow changes the password in idm but it will not add the previous password to the password history.
    It will be helpfull if you paste the code to use this method
    Regards
    Karthik P

    Hi Amar
    Thanks for the reply
    I tried setting the password through setPassword method but its giving an exception ==>java.lang.NoSuchMethodException: java.lang.String.setPassword(com..waveset.util.EncrypteData)
    Then I decrypted the password but no luck getting ==>java.lang.NoSuchMethodException: java.lang.String.setPassword() exception.
    Am i missing something here.do i need to pass the encrypted password in byte array format? if yes how to do that.
    Here encrypted password is coming from a form.
    regards
    karthik p
    .

Maybe you are looking for

  • Have thunderbolt and need to sync ical with google calendar in order to use.  Any suggestions?

    Have a thunderbolt and MacBook.  Need to sync ical with google calendar as thunderbolt supports google calendar.  Any suggestions?

  • AP report purchase in 3 years

    Hi Experts, I got a requirement to create AP report purchase in last 3 years. I need these fields in the BI report. VENDOR NAME1 PO Number PO Date Invoice Date Invoice Due Date Payment Date Days w/o payment Amount Invoice Number Can any one please gu

  • IOS8 will not sync my iPad

    Since installing iOS8, I now find that when I try to sync with iTunes on my iMac, it seems to get stuck on stage 7 wight the caption "Waiting for changes to be applied" and that's it. IMac with OS10, iPad 4 with WiFi and 3gs iOS8

  • High cpu usage (99.9%) on 4510

    My CAT 4510 switch is showing 99.9% CPU usage almost through out the day. After some analysis i saw that the "Cat4k Mgmt LoPri" process is having 86% CPU utilization. This process is a package that is including multiple process. 2.       Within this

  • Getting back my trackpad settings.

    so my hp envy 6 ultrabook gets infected by a virus and a system file gets infected and the OS crashes. i reinstalled windows 7 but now i've lost my trackpad settings eg: two finger scrolling, switching trackpad on or off, in short, all the settings i