How to Get Portlet Namespace in a JSP attribute

Hi All,
The id of any component in a JSF application (with JSR168 portlets) takes the form
'view'+'<portlet:namespace/>'+':'+'formname:componentidname';
I need this id to be used for certain validations.
Currently I am using it as below :-
<h:intputText required="#{ ! empty param['viewns_7_CGAH47L000NAF0I04I42ND10P7_:form:login']}"/>
Presently I have hardcoded the portlet namespace 'ns_7_CGAH47L000NAF0I04I42ND10P7_' by looking into the html source of the rendered page.
Is there any way by which i can automatically get this portlet namespace within the param tag in the jsp.
I know for a fact that within javascript tags, it can be used as <portlet:namespace/> as shown below :-
<script type="text/javascript">
function doSomething()
buttonId= 'view' + '<portlet:namespace/>'+':'+'formName:buttonId';
document.getElementById(buttonId).disabled = true;
</script>
Kindly treat this on high priority.
Thanks and Regards,
Darshan Shroff

Perhaps so.
I need to use it within param as below
<h:inputText value="#{bean.userid}"
required="#{!empty param['viewns_7_CGAH47L00GLRE0I0BCOUKS00I5_:form:login']}" />
Here 'viewns_7_CGAH47L00GLRE0I0BCOUKS00I5_:form:login' is actually
'view' + '<portlet:namespace/>'+':'+'formName:buttonId';
I am just trying to check the presence of the client ID in the request paramameter map inorder to attain action dependent requiredness.
Kindly tell me how i could access it within param.
Thanks & Regards,
Darshan Shroff

Similar Messages

  • How to use portlet:namespace in flex files?

    Hi,
    Iam developing a portlet whose UI is flex. using MXML and action script.
    Portlets require that their UI elements be unique to each portlet, so we use <portlet:namespace> for each ID, vars, functions etc..
    My question is how should i use this tag in my UI?
    Is this the right place to ask this question, if NO, the please direct me to the right forum.
    Thank you,

    application-param tag in weblogic-application.xml may be used to define parameters:
    webapp.encoding.default
    webapp.encoding.usevmdefault
    webapp.getrealpath.accept_context_path
    http://e-docs.bea.com/wls/docs81/programming/app_xml.html#1034632
    "Harshad Nanal" <[email protected]> wrote:
    >
    When we build an ear file , Weblogic-application.xml provides application-param
    tag?
    are they similar to env-entry in ejb-jar.xml.
    Can I use application-param tag to define a configurable params
    say myName and value as "Harshad"
    How do i read it in the application say a simple java class that is included
    in
    a jar inside the ear file.

  • How to get HTML form values in JSP

    retrieve<BR><BR>
    retrieveServicer<BR><BR>
    There are 2 links on a HTML page,code is in HTML page is above. I want to differentiate those two links at run time? Like which link the user has clicked, Is it possible I can do it request.getParameter() method, if so what is the syntax in HTML page and how to get it in JSP page.
    Could you please tell the answer? If anyone knows, Thanks,
    Nivas

    Hi!
    Your question is rather ambigouse!
    I guess you can use some javascript code like this!
    retrieve<BR><BR>
    retrieveServicer<BR><BR>
    <script language="javascript" >
    function a(){
    // you can change any form valuese here submit any form
    function b(){
    // you can change any form valuese here submit any form
    </script>
    If it's not your solution ,please describe you question
    in detail.
    Bye

  • How to get iStore template name from jsp filename?

    Hi,
    We have implemented Oracle iStore R12.
    We have a requirement where we want to get template access name based on jsp file name. e.g. If jsp is ibeCCkdBHdrShip.jsp it should return STORE_CHKOUT_B2B_SHIP_HEADER.
    Is there any java API available for the same?
    We know we can get jsp filename from template access name as follows:
    String jspFilename = DisplayManager.getTemplate("STORE_CHKOUT_B2B_SHIP_HEADER").getFileName()
    However our requirement is other way round..getting access name based on jsp filename.
    Any prompt help/suggestion in this regard is appreciated.
    Thanks,
    Vivek

    Hi Vivek,
                            how about the query? can you use the query in your code ? If yes please use the query below.
    SELECT distinct I.ACCESS_NAME,
    A.FILE_NAME,i.description,I.Item_Name
      FROM JTF.JTF_AMV_ATTACHMENTS A,
      APPS.JTF_AMV_ITEMS_VL I,
      IBE.IBE_DSP_LGL_PHYS_MAP M,
      IBE.IBE_MSITES_TL S
      WHERE
      A.ATTACHMENT_ID = M.ATTACHMENT_ID
      AND I.ITEM_ID = M.ITEM_ID
      AND M.MSITE_ID = S.MSITE_ID
      AND A.File_Name like 'ibeCCtdStBlSuStI.jsp'
      Order by A.File_Name
    Thanks
    Shahzad Qamer

  • How to get price in basket.inc.jsp

    Hi All,
    Could someone let me know if I can get the Gross Value (Total price) in basket.inc.jsp
    When I tried to display the value of price in this jsp I get 0 GBP because
    SalesDocument instance (salesDoc ) which is available in basket.inc.jsp is giving false value for below Boolean fields.
         boolean isTaxValueAvailable = salesDoc.isTaxValueAvailable();
         boolean isNetValueAvailable = salesDoc.isNetValueAvailable();
         boolean isGrossValueAvailable = salesDoc.isGrossValueAvailable();
    Also item.getGrossValue() gives 0 price.
    The reason is the at this stage, in SalesDocumentthe Gross Value is not available.
    Is there any way to get the price at this stage itself?
    I am currently able to get the price in checkout.inc.jsp this is the next file which gets displayed after basket.inc.jsp.
    Thanks
    Neha

    Hi Shanto
    We are using JAVA basket.
    There is absolutely no errors in Pricing.
    We are getting price in checkout.inc.jsp which is next screen to basket.inc.jsp
    The reason is, when program control comes to basket.inc.jsp, the price is not yet calculated due to the reason I think SD_SALESDOCUMENT_CREATE RFC is not yet called,
    Thatu2019s the reason, the methods in basket.inc.jsp which return price is this screen, give 0 price as the values are not yet set.
    It has been this way since beginning, also we checked in Sapu2019s standard code as well, basket.inc.jsp shows 0 price due to the fact, price values arenu2019t set yet.
    Now the scenario, we have new requirement to get the price value in basket.inc.jsp itself.
    Do you have any idea how this can be achieved.
    Thanks
    Neha

  • How to get the alias name of an attribute of a VO from its column name?

    How can I programmatically get the alias name of an attribute of a VO given its column name?
    Often alias and column names are not same when the VO is created (and I don't require them to be the same)

    Hello John.
    I will be more precise. When the VO based on a table comes out from the wizard, it produces xml entries like the following one:
      <ViewAttribute
        Name="ColumnName"
        AliasName="COLUMN_NAME"/>There the column of the table on the DB really is COLUMN_NAME. The wizard mangles that name producing ColumnName as Name property.
    This is ok. I don't want to change this default behaviour.
    What I need is to programmatically get the value of that attribute given its AliasName property value:
    String f(ViewObject vo, String AliasName) {
    return (String)vo.getCurrentRow().getAttributeFromAliasName(aliasName); // getAttributeFromAliasName does not exist
    // instead of return (String)vo.getCurrentRow().getAttribute(Name);
    That is, usually getAttribute expects what in the xml is the Name property. However, I want a sort of getAttribute() expecting the AliasName.
    I hope it's clear.

  • How to get SSO username in a JSP

    Hi,
    How can i get the value for SSO username in my JSP which is being called after the Single Sign On is done. Can anyone help on this?
    Thanks in advance
    Unmesh

    Unmesh --
    I think (albeit I've never tried) that you might be able to get it from the HttpServletRequest using something like:
    User is <%=request.getUserPrincipal().getName()%>[b/]
    The request.getUserPrincipal returns a java.security.UserPrincipal object, which should be populated with the name of the authenticated user.
    Can you see if that works?
    cheers
    -steve-

  • How to get variable from javascript to jsp

    Hi,
    I put a JSP page but in one frame it has a JAVAScript running. The Javascript is a viewer that user can input bounding coordinate and see updated results. Once user input the bounding coordinate in the javascript, I would like to make
    that variable available to the entire JSP, so I can submit all query (include the parameter user input in the JSP form) from jsp at a time. How to do this?
    Thanks
    Kenny

    Hi,
    Okey here is the code. There are three frames.
    1. KennyFrame.htm
    2. MapFrame.htm
    3. kenny.jsp
    Once you run the "KennyFrame.htm" it will show a page
    with two top-bottom frames. The top is
    "MapFrame.htm".
    The bottom is "kenny.jsp"
    Once user input something on MapFrame.htm, it will do
    a process in Javascript then update the "new answer".
    I will need to put that "new answer" into the "What's
    mapFrame Input? " Text box. Therefore, when user click
    on submit on kenny.jsp frame. The "new answer" will be
    submitted.
    Code:
    MapFrame.htm (the main page)
    <body bgcolor="#FFFFFF" text="#000000">
    Newmapframe
    <center>
    <form name=form>
    <input type=text name=box value="type in here!">
    <input type=button value="Convert"
    onClick="javascript:changeCase(this.form.box)">
    </form>
    </center>
    </body>
    </html>
    MapFrame.htm (the code with javascript on top frame)
    <html>
    <head>
    <title>Map Frame Document</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function changeCase(frmObj) {
    var tmpStr;
    tmpStr = "Some answer!";
    frmObj.value = tmpStr;
    // End -->
    </script>
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    Newmapframe
    <center>
    <form name=form>
    <input type=text name=box value="type in here!">
    <input type=button value="Convert"
    onClick="javascript:changeCase(this.form.box)">
    </form>
    </center>
    </body>
    </html>
    kenny.jsp (jsp on bottom frame for final submit)
    <html>
    <head><title>Number Test</title></head>
    <body bgcolor="white">
    <font size=4>
    <form method=get>
    What's mapFrame Input? <input type=text name=guess>
    <input type=submit value="Submit">
    </form>
    </font>
    </body>
    </html>
    let us the say the name of the frame in which kenny.jsp is placed be 'kennyframe' and u change the javascript function 'changeCase()' in MapFrame.htm to below:
    function changeCase(frmObj)
    var tmpStr;
    tmpStr = "Some answer!";
    frmObj.value = tmpStr;
    parent.frames["kennyframe"].document.form.guess.value = frmObj.value;

  • How to get the value in one JSP page to another?

    Hi,
    I have problems in passing the value around in JSP. I have two JSP pages as below:
    test1.jsp
    I try to get the vaule from my textbox by using:
    String strUser = request.getParameter ("strUserName");
    Then i print out by using: out.print(strUser); then i can get the value and put on my page (For example, i get ABC on my page).
    test2.jsp
    Next, i want to get the value from strUser (which mean that the one i already display on page in test1.jsp, ABC) to insert into my table by using INSERT INTO statement. Then i try by using
    String strUser1 = request.getParameter ("strUser");
    Is it possbile for me to do that? I cannot get anything to insert into my table. Then i tried out.print(strUser1); then i found that i get NULL value.
    Could you please give me some guidance?
    Thanks you very much for any advise you may give me.
    Kimsan

    Hi,
    Thank you very much for your help. It's working fine if i just get a one value to another page, however, i have problem while i pass the value in my loop to another page because i always get the last record. I try with the following code:
    logged_page.jsp
    <html>
    <head>
    <title>Welcome to the online Auction...</title></head>
    <body>
    <%@ page language ="java" import = "java.io.*, java.lang.*, java.sql.*" %>
    <% try
         String strUsername = request.getParameter("username");
         session.setAttribute("myUserName", strUsername);     
         String strPassword = request.getParameter("password");
         Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/Auction/Auction.mdb");
         String strSQL = "SELECT [UserName], [Password] FROM tblUserDetails where [UserName] = ? and [Password] = ?";
         PreparedStatement statement = myConn.prepareStatement(strSQL);
         statement.setString(1, strUsername);
         statement.setString(2, strPassword);
         ResultSet myResult = statement.executeQuery();
         if(myResult.next())
         //out.println("Login Succesful! A record with the given user name and password exists");
         out.print("<center><h1>");
         out.print("Welcome  ");
         out.print(strUsername);
         out.print("</h1></center>");
         out.print("<center>");
         out.print("<BR><BR>");
         out.print("<font font face = Viner Hand ITC size= 5>Products on sales</font>");
         out.print("<BR><BR>");
         Statement myStatement = myConn.createStatement ();
         ResultSet myResult1 = myStatement.executeQuery("SELECT * FROM tblProduct");
         ResultSetMetaData myResultSet = myResult1.getMetaData();
         out.println("<font face=Tahoma>");
         out.print("<table border=1 CELLSPACING=0>");
         out.print("<TR>");
         out.print("<TD width = 200> Item Title");out.print("</TD>");
         out.print("<TD width = 200> Description");out.print("</TD>");
         out.print("<TD width = 200> Current bid");out.print("</TD>");
         out.print("<TD width = 200> Available Time");out.print("</TD>");
         out.print("<TD width = 200> Place Bid");out.print("</TD>");
         out.print("</TR>");
         out.print("</table>");
         while(myResult1.next())
              String strProName = myResult1.getString(1);
              session.setAttribute("myProName", strProName);          
              out.print("<table border=1 CELLSPACING=0>");
              out.print("<TR>");
              out.print("<TD width = 200>");
              out.println(strProName);
              out.print("</TD>");
              out.print("<TD width = 200>");
              out.println(myResult1.getString(3));
              out.print("</TD>");
              out.print("<TD width = 200>");
              out.println(myResult1.getString(2));
              out.print("</TD>");
              out.print("<TD width = 200>");
              out.println(myResult1.getString(4));
         out.print("</TD>");
         out.print("<TD>");
              out.print("<form action=bid_page.jsp method=post>");
              out.print("<input type=text name=place_bid>");
              out.print("<input type=submit name=okfunc value=Bid>");
              out.print("</TD>");
              out.print("</form>");
              out.print("</TR>");
              out.print("</table>");
              out.println("</font>");
              out.print("</center>");          
         else
              out.print("<center>");
              out.print("Sorry ");
              out.print("<font color = RED size = 5>");
              out.print(strUsername);
              out.print("</font>");
              out.print(" could not be found.");
              out.print("</center>");
         myResult.close();
         statement.close();
         myConn.close();
         catch(SQLException e)
         out.println(e);
    %>
    </body>
    </html>
    bid_page.jsp
    <HTML>
    <HEAD>
    <TITLE>Welcome to the online Auction...</TITLE>
    </HEAD>
    <BODY>
    <%@ page language ="java" import = "java.io.*" import = "java.lang.*" import = "java.sql.*" %>
    <% try
         String thisUserName = (String) session.getAttribute("myUserName");
         String thisProName = (String) session.getAttribute("myProName");
              Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/Auction/Auction.mdb");
         PreparedStatement myStatement = myConn.prepareStatement("INSERT INTO tblHistory VALUES ('"+thisUserName+"', '"+thisProName+"', '"+request.getParameter("place_bid")+"')");
              myStatement.executeUpdate();
              myConn.commit();
              myStatement.close();
              myConn.close();
              catch(Exception e){}
    %>
    </BODY>
    </HTML>
    When i click on the BID button in the logged_page.jsp then i always get the last record and save into my table and that is not what i want to. i want to get the result on the same row as the BID button that just click and save to my table.
    Could you please advise?
    Thanks you very much for your time and any consideration you may give me.
    Best Regard,
    Kimsan

  • How to get a Value of a JSP field/Attribute?

    Hi im trying to get a value of a field from the EditCurrentRecord databeans. Im trying get the Value of the Attribute "Mdepempno", which will be used as a search field in the next customized webBean.
    Any suggestion? Thanks
    Muraly
    -- here is a portion of the code----
    RowEditor.useEditField("Mdepempno");
    RowEditor.getFieldRenderer("Mdepempno").setPromptText("Dept Manager");
    empnumber = RowEditor.getFieldRenderer("Mdepempno").toString();
    null

    Hi I managed to find the solution, by refering to the earlier replies..
    adding the following codes in teh .jsp page solve the problem.
    <%
    Row row = rsn.getRowSet().getCurrentRow();
    %>
    <% String empnumber = row.getAttribute("Mdepempno").toString(); %>
    Thanks for reading.
    regards
    muraly
    null

  • How to get the action-mapping in jsp page in struts

    Hi,
    I want get, in my login.jsp, the name of action mapping that call my
    login.jsp.
    Is possible?
    suppose abc.do called my login.jsp
    now i need to know the name of action-mapping here abc
    Thanks,

    Depending on what you need, I believe Struts 1.3 creates a request attribute called "org.apache.struts.globals.ORIGINAL_URI_KEY". In your case, it looks like this would be set to the string "/abc.do". There should also be a request attribute called "org.apache.struts.action.mapping.instance" that contains an instance of ActionConfig. I think both of those keys are defined by the Globals class.

  • How to get a namespace

    Hi... Anyone know where at the service.sap.com portal you can order a namespace... I was told it was at "service.sap.com/smb/namespace" or "service.sap.com/namespace" but none of these urls works... Can anyone give me the correct url?

    https://websmp103.sap-ag.de/namespaces
    Try the above link. It took me quite a while to find it.
    SAP definitely has to get the portal a lot more organized.
    Don't hesitate to continue requesting a namespace although things do not seem to fit for SAP Business One.
    HTH Lutz Morrien

  • How to get credentials (password) in a jsp

    Hi
    Our application is launched as a jsp which has an applet communicating
    with a rmi server. The jsp page is served as an WAR. The server
    requires the password and the user name. For this we used the
    statements
    <PARAM NAME="userName" VALUE="<%= request.getRemoteUser() %>">
    <PARAM NAME="password" VALUE="<%= ( (weblogic.security.acl.User)
    request.getUserPrincipal() ).getCredential( request.getUserPrincipal()
    ) %>">
    in our jsp. The second line always returns a blank string (something
    is null).
    Do we have to setup something in the weblogic properties to enable it
    or should do somethig different in the code.
    thanks in advance
    suren

    Hi Suren!
    Suren schrieb:
    Hi
    Our application is launched as a jsp which has an applet communicating
    with a rmi server. The jsp page is served as an WAR. The server
    requires the password and the user name. For this we used the
    statements
    <PARAM NAME="userName" VALUE="<%= request.getRemoteUser() %>">
    <PARAM NAME="password" VALUE="<%= ( (weblogic.security.acl.User)
    request.getUserPrincipal() ).getCredential( request.getUserPrincipal()
    ) %>">
    in our jsp. The second line always returns a blank string (something
    is null).I've got this problem too. You can solve this by implementing a realm, that overwrites
    the getCridential method and returns the password. I'm using an RDBMS realm and it
    works fine.
    Best regards,
    Przemek

  • How to get the tld value in jsp

    Hi Folks,
    i want to call the tld value in my jsp page.
    here is my tld:
    <taglib> <tlibversion>1.0</tlibversion> <jspversion>1.1</jspversion> <shortname>search</shortname> <info>TagLib for the regain search engine</info> <tag> <info> Writes a link to the current hit's document. For the link text the title is used. This tag must be inside a link tag. </info> <name>hit_link</name> <tagclass>com.test</tagclass> <bodycontent>empty</bodycontent> <attribute> <description> The CSS style sheet class to use for the link. </description> <name>class</name> <required>false</required> </attribute> </tag>my jsp:
    <%@page contentType="text/html; charset=UTF-8" errorPage="errorpage.jsp"%> <%@taglib uri="test.tld" prefix="search" %> <%@ page language="java" import="java.util.*,java.sql.*,java.net.*,java.io.*" %> <%System.out.println(%><search:hit_link/><%);%>Regards,
    __________________

    You are missing the <uri> tag in your .tld file. Something like this...
    <taglib>
         <tlibversion>1.0</tlibversion>
         <jspversion>1.1</jspversion>
         <shortname>search</shortname>
         <uri>mytesttld</uri>
    </tag>In your .jsp file, your refer to the uri in this fashion.
    <%@taglib uri="mytesttld" prefix="search" %> Also, make sure that you have your .tld file under WEB-INF or WEB-INF/tlds folder of your app.
    And, I assume that you are on JSP2.0 or later. Which server with version are you using ?

  • How to get a dynamic pages using jsp?

    actually using jsp we create static pages.
    My question is whether it is possible to create dynamic pages. ie the page should reflect changes without refreshing or reloading. for example we have date timings frequently updated without refreshing

    Read Beginning JSP from WROX Press. It is a good book for developing dynamic JSP using all latest technologies.

Maybe you are looking for

  • Unable to open MS Office 2004 after updating to Safari 5.1.4

    I was not having any problems until I updated my Safari to the latest version, 5.1.4.  Now I can't get into any of my MS Office applications or my HP Director.  I get a message saying "____ quit unexpectedly. Click Reopen to open the application agai

  • Socket OutputStream

    Hi, I've been working on something with a friend of mine, which includes server-client communications, and I've encountered something that I can't understand. What's happening, is, well, I'll just show you an SSCCE and then make it simple under that.

  • Populating combobox in jsp page from javabean using jsp:getProperty tag

    hi, i am new to jsp, so i don;t know how to populate a combobox in jsp page with productid attribute from a javabean called Bid . i want to have a code to automatically populating combobox using the attribute value from javabean. please reply me. <js

  • Weblogic 12.1.2 configure or create new domain results in CN error

    I have downloaded weblogic server installation 'https://community.oracle.com/Zip distribution for Mac OSX, Windows and Linux' from  http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html A month back, I have successfully

  • Why can´t I wire the offset input in the Write File Function when I use datalog files ?

    Hi ! I have a datalog file, in which I save variant data several times in diferents VIs, I runs these randomly, and I would like rewrite only a part of the file, but I can´t wire the offset input in the Write File function to indicates the begins and