Setting a response header in a CQ5 publishing instance

I want to disable caching in a CQ component and I have the following line in my jsp (documentation):
response.setHeader("Dispatcher", "no-cache");
If I insert the component in a page and load the page in an authoring instance everything works as expected and I get an HTTP header named Dispatcher with the content no-cache.
Now if I do the same on a publishing instance (same configuration with CQ_RUNMODE='publish' and same content) the component works but for setting the HTTP header.
Any idea on why the two instances could behave differently?

I checked that the code is published and I tried to generate a minimal example.
While removing unnecessary stuff from the page I noticed that after a given threshhold the header is generated.
This buy just removing HTML (no code). I reach a point where if I remove a simple
<div></div>
the page is correctly delivered with the header, if I insert it back the header is no more there.
Could this be related to HTTP chunking? If yes how can I disable it to debug?

Similar Messages

  • Setting the response header through JavaScript

    Hi guys
    I have to show a file to the client using the browser, I have the file contents stored in my Blob Field in the Database. Now I want to display the file on clilck of a button called DOWNLOAD and then determine the type of file, correspondingly setting the contentType and setHeader of response object. How can i do that??? Please help me at ur earliest...
    Thanx

    Hi,
    I have created a JSP Page that will send a picture to the browser based on an ID that it is passed. Hope this helps a bit.
    Gr. Arjan
    <%
         String strDiscId = request.getParameter("id");
         int discId = Integer.parseInt(strDiscId);
         Disc myDisc = new Disc();
         myDisc.retrieve(discId);
         response.setContentType("image/jpeg");
         response.getOutputStream().write( myDisc.getImage() );
         response.getOutputStream().flush();
    %>

  • How to set response header in filter

    Hi,
    i want to set the response header in my security filter:
    private void setHeader() {
              FacesContext ctx = FacesContext.getCurrentInstance();
              if (ctx != null){
                   HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
                   response.setHeader("Pragma", "No-Cache");
                   response.setDateHeader("Expires",0);
                   response.setHeader("Cache-Control", "no-cache");
         }But ctx is always null? What am i doing wrong?
    Regards,
    barnti

    My understanding is you will not have Faces Context in a filter as you have not yet hit the faces lifecycle..
    Try the below to get the context.
         * (non-Javadoc)
         * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
        public void init(FilterConfig config) throws ServletException {
            setFilterCfg(config);
            setServletCtx(filterCfg.getServletContext());
         * Since your typical FacesContext.getCurrentInstance() will probably be
         * null due to the fact we have not hit the faces lifecycle yet, we must dup
         * some of the faces servlet code here to create a new current instance.
         * @param req
         * @param res
         * @return FacesContext which is fresh and virtually empty.
        protected FacesContext getFacesContext(ServletRequest req,
                ServletResponse res) {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            if (facesContext != null) {
                return facesContext;
            //     Use the FactoryFinder to grab the Lifecycle object
            FacesContextFactory contextFactory = (FacesContextFactory) FactoryFinder
                    .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
            LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder
                    .getFactory(FactoryFinder.LIFECYCLE_FACTORY);
            Lifecycle lifecycle = lifecycleFactory
                    .getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
            facesContext = contextFactory.getFacesContext(servletCtx, req, res,
                    lifecycle);
            ProtectedFacesContext.setFacesContextAsCurrentInstance(facesContext);
            return facesContext;
        }

  • Setting response header without scriptlet

    Can I set a response header from JSP without using a scriptlet?
    With scriptlets I can do <%response.addHeader("name", "header")%>
    but is there also a JSTL tag or similar to do it? (Except for writing a custom tag myself)

    As far as i know JSTL is not designed for this, as it is designed to work as a view language in the mvc model.
    And since you handle requests and responses in a controller, I don't think there will be something for JSTL.

  • How to manage users on multiple publish instances?

    I am setting up a cloud that has mutliple publish instances that the dispatchers and load balancer handle.  Currently there are only 2 publish instances, but there could very possibly be more.  I ran into an issue that when a user goes to the site, if they sign up, it only sends their information to ONE of the publish machines (the one that they were directed to).  Then when I try to login to the site, the first few attempts fail, because I am being directed to the other publish instance, which doesn't have my credentials on it.  How would you suggest going about doing this?  I have considered reverse-replication back to the author (and then having that replicate), or clustering the publish instances (although I don't know much about that at all), but I'm really not sure what the best route is, or if there is a different route I don't know about.

    Follow this link and check it helps you.

  • Setting content-type response header in BlazeDS

    Per this JIRA ticket, http://bugs.adobe.com/jira/browse/BLZ-428 , there is a suggested fix that includes setting the response content-type header to text/xml.
    The JIRA ticket name is
    pinging endpoint Returns a HTTP: Status 200 in ie8
    and the suggested fix is:
    The problem appears to be completely worked around by setting the following headers in our HTTP responses to Flash:
    Content-Type: text/xml; charset=UTF-8
    Cache-Control: no-cache
    What is the best way to do this is if using BlazeDS?
    I have tried to set the content-type within my data service desitnation class, by accessing the HttpServletResponse from the FlexContext class, however this does not work.  The content-type is still "application/x-amf" in the response.    I am assuming that BlazeDS sets the content-type sometime after my data service desination code is invoked.
    I have also tried to create a servlet filter and set the content-type header both before and after (in a finally block) my data service code is invoked, however neither of these approaches successfully ended up with a content-type of "text/xml" in the response.  My sense is that setting the content-type prior to the data service destination code is too early in the chain and setting in the finally block is too late (per the servlet spec you cannot set the content-type after getWriter() has been called).
    Any ideas are appreciated.
    Also any other ideas on how to solve the general IE8 issue described in the bug above are appreciated.
    I am using...
    BlazeDS version: 3.2.0.3978
    Flex SDK version: 3.4
    App Server: JBoss 4.5
    Java: 1.5_16
    Thanks,
    Kevin

    Hi,
    in the meantime I found a "known issue" that seems to be related to my problem but it is said to be fixed with 10.0 MP1 (and we use 10.3):
    ChangeRequest number: CR316761, CR318708
    Description. The servlet container used to append charset=ISO-8859-1 to the HTTP Header contentType in the response for non-JSP pages with any charset contents. This would result in improper display of multibyte characters.
    This problem has been resolved.
    Maybe the information is wrong. I will examine the CR and may apply them on our 10.3 environment but I would be glad if some oracle/bea engineer would intervene here.
    Cheers
    Thorsten

  • Setting response header fron JSP

    Hi
    I would like to know how I can set "If-Modified-Since" header, so that when client refreshes the page again the server should send 304 (Not Modified) status to the client.
    I was able to do this in servlets as follows,
    {code}
    class Servlt extends HttpServlet
        private long modifiedTime ;
        init()
            modifiedTime=System.timeMilliSeconds /1000*1000;
        //service method automatically calls getLastModified() for the conditional GET
        long getLastModified()
             return modifiedTime;
    {code}
    How I can achieve the same in JSP ?
    Is this work for POST method?
    Is refreshing the browser submits page with GET or POST ?
    Please help me understanding these and the solution for the above using JSP.
    Thanks in advance.{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Try to set "Last-Modified" response header via setDateHeader method.

  • Problem while setting response header in a filter

    Hi,
    I am intercepting response in a filter and trying to modify the response header, so that my subsequent class would get the header in request .
    Somehow i don't get the header in request. I don't know whats going wrong.
    I have few more filters other than the one in which i m modifying the response header.
    I change the response header before calling doFilter() method.
    Where am i going wrong ?

    The subsequent servlets and filters will get the same request that the first filter has. The passing to the next servlet is via a method call.

  • RFX Response Header : Fill Display Fields on Header Level

    Hi Gurus,
    There is a requirement at the client place to add the Display only field for RFx Response Header. Based on this required I have done the following activities.
    1. From 'Define Customer Display Fields on Header Level' in  SPRO i have appended the ZFIELD in the Response header structure.
    2. From 'Configure Control for Fields on Header Level' in SPRO i have made it visible true.
    3. From 'Fill Display Fields on Header Level' SPRO i have Enhanced the /SAPSRM/BD_PDO_FE_FILL_HEADER with implementation. And have given required filter criteria. In the implementation Class it has the return parameter as CS_HEADER_DATA. Where i could fill the my ZFIELD.
    The field is now displaying in the SRM portal. But the problem is that the ZFIELD is not being filled with any value, even though i supplied it.
    Is there any step that is missing to set the value?
    Regards,
    Hobs

    Hi,
    The main technique is to do your calculations in PAI of the screen for additional data B for the line item but as you said it is accessed only when you goto-> item -> additional dataB
    So you can do one more thing...do the calculation in PAI/PBO of the screen first and in userexit_save_document_prepare recalculate again and overwrite the old ones(or calculate for only the ones which are initial in the item) ..so if he goes to additional data B screen you give the user what he wants and if he doesn't userexit_save_document_prepare takes care of it
    user can go to additional dataB only a line item at a time so the chance that he takes all the line items one by one is less(for huge number of line items)..so you just calculate and overwrite the fields in the in the userexit if the field value is empty...or you can recalculate for all the cases and overwrite just in case there may be a problem....
    in the screen of the additional dataB
    Write logic for calculating the field values
    so in the userexit you write like
    if the fields are initial..
    calculate
    else
    *already calculated from the screen because user has viewed it
    endif.
    So you are safe that user can see what he wants and you can reassure that the value will be calculated and stored on the SAVE from user exit
    Please check,revert
    Reward if helpful
    Regards
    Byju

  • How to change response header from bex application?

    HI.
    I'd like to change language coding 'charset=gb2312' to 'charset=big5' and don't need to add neither 'big5' language package or unicode in server
    because the contents are input as 'big5' so I just need change charset incoding type.
    and even if I insert html code
    '<meta http-equiv="content-type" content="text/html; charset=big5">'
    very top of template.
    'big5' is not working because the response header is set as 'gb2312'.
    and as I said before don't need to install lanaguage package to server.
    just want to change response header
    but don't know how to do that.
    is there anyone who knows tip for this?
    thank you.

    Just to close this topic.
    I have reported a bug to Android project, because bottom-line they are responsible for the error - not SAP BEx.
    Anyone interested can see the bug report here:
    [http://code.google.com/p/android/issues/detail?id=24257]
    If you decide to look at the bug report, please mark it with a Star to bring focus on this problem.
    Best regards,
    Jacob

  • How to reset the response status and response header

    Dear Masters
    Actually we are using NTLM Authentication process to get the system login id for our web application. The problem which I am getting is after running the NTLM Authentication Code I am not able to call the action class. It is telling 400 Server error bad request. I am using Struts Dispatch Action Class. In Dispatch Action I will be passing a name (eg. method) as a parameter in struts-config.xml file and using that parameter I will be calling the respective method in the Action class. The problem which I am facing is after running the authentication code I am not able to fire the action class. It is telling the error in the console as "parameter named method is not found". Actually in NTLM Authentication code they are setiing the response status to www-authenticate,NTLM. If I reset the response status back to the normal form I think i will be able to fire the action class. Please give me a suggestion on how to reset the response status and response header back to the normal form. Any solution to this is appreciated. Please respond your reply as soon as possible. Thanks in advance.
    Regards
    Ramesh

    Hi,
    I think, a servlet filter is what you need. Please check the following URLs on how to go about creating a filter.
    http://dev2dev.bea.com/pub/a/2005/05/decorators.html
    http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html
    http://www.onjava.com/pub/a/onjava/2004/03/03/filters.html?page=1
    Cheers,
    vidyut

  • Can you please help to understand how the firefox decides on the Expires date for a cached javascript file ( my server did not set any Expire header, but firebox set it down).

    # Question
    Can you please help to understand how the firefox decides on the Expires date for a cached javascript file ( my server did not set any Expire header, but firebox set it down). I tried to understand but different javascript file gets different Expires date value when it is being cached. Please help me as I tried lot and could not get proper answer for this. Thanks in Advance.

    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox. <br />
    http://forums.mozillazine.org/viewforum.php?f=25 <br />
    You'll need to register and login to be able to post in that forum.

  • How do I set the Track Header in such a way that both the solo and mute are turned off?

    How do I set the Track Header in such a way that both the solo and mute are turned off?

    Another possible solution is to use a battery grip on your 70D and see if the dial on the grip will change the shutter speed.
    There are some discussions about this problem on some earlier models Canon DSLR. Check it out.
    http://www.dpreview.com/forums/thread/2638326

  • Wrong content length in response header, ICM

    Hello,
    When i checked in the SMICM log file i got the error message:
    [Thr 1085303104] *** ERROR => HttpClntHdlResponse: client: premature EOS (28980/59150) - wrong content length in response header
    Kindly let me know what may be the cause of this error.
    Kind regards
    Lutz

    Hi Raghu and Anil,
    here are some more information:
    Kernel-Release    700
    Compilation       Linux GNU SLES-9
    Patch-Level       201
    SAP_ABA     700     0019     SAPKA70019
    SAP_BASIS     700     0019     SAPKB70019
    PI_BASIS     2005_1_700     0019     SAPKIPYJ7J
    ST-PI     2008_1_700     0000          -
    SAP_BW     700     0021     SAPKW70021
    SAP_AP     700     0016     SAPKNA7016
    SAP_APPL     600     0015     SAPKH60015
    SAP_HR     600     0038     SAPKE60038
    ST-A/PI     01L_ECC600     0000          -
    ICM Parameter
    Services
    icm/server_port_0     = PROT=HTTP,PORT=8022
    icm/server_port_1     = PROT=SMTP,PORT=0
    Hard limits
    icm/max_services               = 30
    icm/listen_queue_len           = 512
    icm/req_queue_len              = 500
    icm/max_conn                   = 500
    icm/max_sockets                = 2048
    Thread handling
    icm/min_threads                = 10
    icm/max_threads                = 50
    icm/min_spare_threads          = 3
    Tracing and statistic
    rdisp/TRACE                    = 1
    icm/tracefile                  = dev_icm
    icm/log_level                  = 0
    icm/stat_level                 = 1
    icm/security_log               = LOGFILE=dev_icm_sec,MAXSIZEKB=500
    icm/accept_remote_trace_level  = 0
    Monitoring
    icm/ccms_monitoring            = 1
    icm/ccms_refresh_rate (sec.)   = 30
    Timeout handling
    icm/keep_alive_timeout (sec.)  = 60
    icm/conn_timeout (msec.)       = 5000
    HTTP settings
    icm/HTTP/max_request_size_KB   = 102400
    icm/HTTP/server_cache_0        = PREFIX=/, CACHEDIR=/usr/sap/PF1/DVEBMGS22/dat
    a/cache
    icm/HTTP/admin_0               = PREFIX=/sap/admin,DOCROOT=/usr/sap/PF1/DVEBMG
    S22/data/icmanroot/admin,AUTHFILE=/usr/sap/PF1/SYS
    icm/HTTP/auth_0                = PREFIX=/,FILTER=SAP
    HTTP(S) error handling
    is/HTTP/show_detailed_errors   = 1
    HTTPS (SSL) settings
    icm/HTTPS/verify_client        = 1
    ssf/name                       =
    ssf/ssfapi_lib                 =
    sec/libsapsecu                 =
    ssl/ssl_lib                    =
    Context Quotas
    icm/HTTP/context_quota         = 90%
    icm/HTTPS/context_quota        = 90%
    icm/SMTP/context_quota         = 90%
    Memory Pipe settings
    mpi/total_size_MB              = 80
    mpi/buffer_size                = 65536
    J2EE settings
    rdisp/j2ee_start               = 0
    is/HTTP/default_root_hdl       = J2EE
    Content Filter settings
    csi/enable                     = TRUE
    csi/SAP/csa_lib                = /usr/sap/PF1/DVEBMGS22/exe/libsapcsa.so
    Misc
    icm/host_name_full             = cipf122.ikk.local
    icm/cancel_strategy            = cancel requests without session (stateless)
    rdisp/plugin_auto_logout       = 1800
    is/HTTP/virt_host_0            = :;
    is/SMTP/virt_host_0            = :;
    Best regards
    Lutz

  • Set row as header using applescript

    I am new to AppleScript and I am writing my first script to crunch some data in numbers. I am trying to figure out how to set row one as the header row in sheet 1 using the script. Can anyone help?

    Here is a script a bit more powerful that what you asked for but it's of more general use.
    --{code}
    --[SCRIPT set_count_of_Xers]
    Enregistrer le script en tant que Script : set_count_of_Xers.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Aller au menu Scripts , choisir Numbers puis choisir “set_count_of_Xers”
    En fonction des paramètres passés, le script fixera le nombre de Rangs d’en-tête, Colonnes d’en-tête ou Rangs de bas de tableau dans le tableau table_name de la feuille sheet_name du document doc_name.
    --=====
    L’aide du Finder explique:
    L’Utilitaire AppleScript permet d’activer le Menu des scripts :
    Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case “Afficher le menu des scripts dans la barre de menus”.
    Sous 10.6.x,
    aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
    puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
    --=====
    Save the script as a Script: set_count_of_Xers.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Go to the Scripts Menu, choose Numbers, then choose “set_count_of_Xers”
    According to the defined parameters, the script will set the count of HEADer ROWs, HEADer COLUMNs or FOOTer ROWS in the table table_name of the sheet sheet_name in the document doc_name.
    --=====
    The Finder’s Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the “Show Script Menu in menu bar” checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/09/21
    --=====
    property forTests : false
    true may be useful for tests. It triggers the handler select_SubMenu which list the UI elements.
    false is the setting to apply when the script is finished because it runs faster.
    --=====
    on run
              my activateGUIscripting()
    This script is a general one allowing to treat the defined table
              set doc_name to 1
              set sheet_name to "Feuille 2"
              set table_name to "Tableau 1"
              set which_item to 10
              set nb_Xers to 1
              my setNbXers(doc_name, sheet_name, table_name, which_item, nb_Xers) (* to set 1 HEADer ROW *)
    end run
    --=====
    which = 10 --> set count of HEADer ROWs
              my setNbXers(1, "Feuille 2", "Tableau 1", 10, 1) (* to set 1 HEADer ROW *)
    which = 11 --> set count of HEADer COLUMNs
              my setNbXers("my doc.numbers", "Sheet 5", "Table aux", 11, 4) (* to set 4 HEADer COLUMNs *)
    which = 14 --> set count of FOOTer ROWs
              my setNbXers("ASCII.numbers", "Sheet of paper", "TableTop", 14, 3) (* to set 3 FOOTer ROWs *)
    on setNbXers(docName, sheetName, tableName, whichItem, nbXers)
              my selectTable(docName, sheetName, tableName)
              if forTests then
                        my select_SubMenu("Numbers", 6, whichItem, nbXers + 1)
              else
                        my selectSubMenu("Numbers", 6, whichItem, nbXers + 1)
              end if
    end setNbXers
    --=====
    set { dName, sName, tName,  rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    on get_SelParams()
              local d_name, s_name, t_name, row_num1, col_num1, row_num2, col_num2
              tell application "Numbers" to tell document 1
                        set d_name to its name
                        set s_name to ""
                        repeat with i from 1 to the count of sheets
                                  tell sheet i to set maybe to the count of (tables whose selection range is not missing value)
                                  if maybe is not 0 then
                                            set s_name to name of sheet i
                                            exit repeat
                                  end if -- maybe is not 0
                        end repeat
                        if s_name is "" then
                                  if my parleAnglais() then
                                            error "No sheet has a selected table embedding at least one selected cell !"
                                  else
                                            error "Aucune feuille ne contient une table ayant au moins une cellule sélectionnée !"
                                  end if
                        end if
                        tell sheet s_name to tell (first table where selection range is not missing value)
                                  tell selection range
                                            set {top_left, bottom_right} to {name of first cell, name of last cell}
                                  end tell
                                  set t_name to its name
                                  tell cell top_left to set {row_num1, col_num1} to {address of its row, address of its column}
                                  if top_left is bottom_right then
                                            set {row_num2, col_num2} to {row_num1, col_num1}
                                  else
                                            tell cell bottom_right to set {row_num2, col_num2} to {address of its row, address of its column}
                                  end if
                        end tell -- sheet…
                        return {d_name, s_name, t_name, row_num1, col_num1, row_num2, col_num2}
              end tell -- Numbers
    end get_SelParams
    --=====
    on parleAnglais()
              local z
              try
                        tell application "Numbers" to set z to localized string "Cancel"
              on error
                        set z to "Cancel"
              end try
              return (z is not "Annuler")
    end parleAnglais
    --=====
    on decoupe(t, d)
              local oTIDs, l
              set oTIDs to AppleScript's text item delimiters
              set AppleScript's text item delimiters to d
              set l to text items of t
              set AppleScript's text item delimiters to oTIDs
              return l
    end decoupe
    --=====
    on activateGUIscripting()
      (* to be sure than GUI scripting will be active *)
              tell application "System Events"
                        if not (UI elements enabled) then set (UI elements enabled) to true
              end tell
    end activateGUIscripting
    --=====
    ==== Uses GUIscripting ====
    on selectTable(theDoc, theSheet, theTable)
              local maybe, targetSheetRow, rowIndex, r
              try
                        tell application "Numbers"
      activate
                                  set theDoc to name of document theDoc (* useful if the passed value is a number. Checks also that we passed the name of an open doc *)
                        end tell -- Numbers
              on error
                        if my parleAnglais() then
                                  error "The spreadsheet “" & theDoc & "” is not open !"
                        else
                                  error "Le tableur « " & theDoc & " » n’est pas ouvert ! "
                        end if -- my parleAnglais
              end try
              try
                        tell application "Numbers" to tell document theDoc
                                  set theSheet to name of sheet theSheet (* useful if the passed value is a number and check the availability of theSheet if it’s a string *)
                        end tell -- Numbers
              on error
                        if my parleAnglais() then
                                  error "The sheet “" & theSheet & "” is unavailable in the spreadsheet “" & theDoc & "” !"
                        else
                                  error "La feuille « " & theSheet & " » n’existe pas dans le tableur « " & theDoc & " » ! "
                        end if -- my parleAnglais
              end try
              try
                        tell application "Numbers" to tell document theDoc to tell sheet theSheet
                                  set theTable to name of table theTable (* useful if the passed value is a number and check the availability of theSheet if it’s a string *)
                        end tell -- Numbers
              on error
                        if my parleAnglais() then
                                  error "The table “" & theTable & "” is unavailable in the sheet “" & theSheet & "”  of the spreadsheet “" & d & "” !"
                        else
                                  error "La table « " & theTable & " » n’existe pas dans la feuille « " & theSheet & " »  du tableur « " & d & " » ! "
                        end if -- my parleAnglais
              end try
              set maybe to 5 > (system attribute "sys2")
              tell application "System Events" to tell application process "Numbers"
                        tell outline 1 of scroll area 1 of splitter group 1 of splitter group 1 of window theDoc
                                  if maybe then (* macOS X 10.4.x
    '(value of attributes contains 0)': '(value of attribute "AXDisclosureLevel" is 0)' sometimes works in Tiger, sometimes not.
    The only possible instances of 0 amongst the attributes are the disclosure level of a sheet row and the index of the first row, which represents a sheet anyway.
    Another possibility is '(value of attribute -1 is 0)', which makes me uneasy. *)
                                            set targetSheetRow to first row where ((value of attributes contains 0) and (value of first static text is theSheet))
                                  else (* macOS X 10.5.x or higher *)
                                            set targetSheetRow to first row where ((value of attribute "AXDisclosureLevel" is 0) and ((groups is {}) and (value of first static text is theSheet)) or (value of first group's first static text is theSheet))
                                  end if -- maybe
                                  tell targetSheetRow to set {value of attribute "AXSelected", value of attribute "AXDisclosing"} to {true, true}
      -- Get the sheet row's 0-based index + 2 for the following row's 1-based index.
                                  set r to (value of attribute "AXIndex" of targetSheetRow) + 2
                                  repeat until (value of first static text of row r is theTable)
                                            set r to r + 1
                                  end repeat
                                  set value of attribute "AXSelected" of row r to true
                        end tell -- outline 1 …
              end tell -- System Events
    end selectTable
    --=====
    my selectSubMenu("Pages",6, 4, 26)
    ==== Uses GUIscripting ====
    on selectSubMenu(theApp, mt, mi, ms)
              tell application theApp
      activate
                        tell application "System Events" to tell process theApp to tell menu bar 1 to ¬
                                  tell menu bar item mt to tell menu 1 to tell menu item mi to tell menu 1 to click menu item ms
              end tell -- application theApp
    end selectSubMenu
    --=====
    useful to get the indexs of the triggered item
    my select_SubMenu("Numbers", 6, 10, 1+1) (* Table > Header rows > 1 *)
    on select_SubMenu(theApp, mt, mi, ms)
              tell application theApp
      activate
                        tell application "System Events" to tell process theApp to tell menu bar 1
                                  get name of menu bar items
    01 - "Apple",
    02 - "Numbers",
    03 - "Fichier",
    04 - "Édition",
    05 - "Insertion",
    06 - "Tableau",
    07 - "Format",
    08 - "Disposition",
    09 - "Présentation",
    10 - "Fenêtre",
    11 - "Partage",
    12 - "Aide"}
                                  get name of menu bar item mt
      -- {"Tableau"}
                                  tell menu bar item mt to tell menu 1
                                            get name of menu items
    01 - "Insérer un rang d’en-tête au-dessus"
    02 - "Insérer un rang d’en-tête en dessous"
    03 - missing value
    04 - "Insérer une colonne d’en-tête avant"
    05 - "Insérer une colonne d’en-tête après"
    06 - missing value
    07 - "Supprimer le rang"
    08 - "Supprimer la colonne"
    09 - missing value
    10 - "Rangs d’en-tête"
    11 - "Colonnes d’en-tête"
    12 - "Bloquer les rangs d’en-tête"
    13 - "Bloquer les colonnes d’en-tête"
    14 - "Rangs de bas de tableau"
    15 - missing value
    16 - "Ajuster les rangs au contenu"
    17 - "Ajuster les colonnes au contenu"
    18 - missing value
    19 - "Afficher tous les rangs"
    20 - "Afficher toutes les colonnes"
    21 - "Activer toutes les catégories"
    22 - missing value
    23 - "Fusionner les cellules"
    24 - "Diviser en rangs"
    25 - "Diviser en colonnes"
    26 - missing value
    27 - "Répartir les rangs uniformément"
    28 - "Répartir les colonnes uniformément"
    29 - missing value

Maybe you are looking for