How to set Principal object?

Hello,
I have two web applications. The "app1" is the one we are developing and retrieving the Principal object. The "app2" is a black box web application which we have no way to modify. We can only add parameters in web.xml. The business flow is that once the Principal object is retrieved in "app1", the "app1" calls "app2". The "app2" is looking for User_Principal object. The document says "USER_PRINCIPAL = (The user name is retrieved from a call to getUserPrincipal().getName() on the HttpServletRequest object for the current request in a servlet or JSP)". If I understand this correctly, the "app2" is going to look for "HttpServletRequest". How can the "app1" set Principal object so that "app2" can retrieve it from "HttpServletRequest"? As far as I know there is not "setUserPrincipal()" method in "HttpServletRequest". So the app1 cannot use "HttpServletRequest".
Thanks in advance,
Mustafa

The UserPrinciple is set by the server after the user has been successfully authenticated. You should force the user to login to the second application using the <security-constrain> entry in web.xml. If your user has already been authenticated in your first application than make sure that you have the Realm the user is authenticated to available for both web apps.

Similar Messages

  • How to set a object value bound to a session to JavaScript variable

    In a JSP, I store an object value in a HttpSession and I also write a Javascript function to display something on the screen. I need to use the Javascript function to display the object value which is stored in the session. How to set the object value to variable of the JavaScript function. Thanks.

    I write a class JavaScriptHelper to convert the object value to variable of the JavaScript;
    1.get the data to a javabean from database;
    2.convert the data to variable of the JavaScript as a String ;
    3.store the object in a HttpSession or Httprequest ;
    4.use in Jsp get the String (variable of the JavaScript )
    YourBean bean = (YourBean) request.getAttribute("model");
         if (bean != null) out.println(bean .getJsCode())
    convert function,(this is only for the matrix):
    public static String formatJsCode(Vector vector) {
    String sJsCode = "";
    //get js head
    sJsCode = getJsHeader();
    //define js array;
    sJsCode += "var data=new Array();\n";
    Vector v = null;
    String sTemp = "", sLine = "";
    for (int i = 0; i < vector.size(); i++) {
    v = (Vector) vector.get(i);
    sLine = "";
    for (int j = 0; j < v.size(); j++) {
    sTemp = (String) v.get(j);
    //replace " to \"
    sTemp = sTemp.replaceAll("\"", "\\\\\\\"");
    //escape Html Tag
    //sTemp = StringUtil.escapeHTMLTags(sTemp);
    //replace \r\n to <br>
    sTemp = sTemp.replaceAll("\r\n", "<br>");
    if (j != 0)
    sLine += ",";
    sLine += "\"" + sTemp + "\"";
    sJsCode += "data[" + i + "]=new Array(" + sLine + ");\n";
    //get js foot
    sJsCode += getJsFooter();
    return sJsCode;
    public static String getJsHeader(){
    return "<script language=\"JavaScript\">";
    public static String getJsFooter(){
    return "</script>";
    }

  • How to set a Object value by JDI

    How to set a Object value using JDI?
    For example:
    class User{
      private String name;
      private String id;
    set and get method;
    public static void main(String[] args) throws Exception {
            VirtualMachineManager vmm = Bootstrap.virtualMachineManager();
            List<AttachingConnector> connectors = vmm.attachingConnectors();
            SocketAttachingConnector sac = null;
            for (AttachingConnector ac : connectors) {
                if (ac instanceof SocketAttachingConnector) {
                    sac = (SocketAttachingConnector) ac;
                    break;
            if (sac == null) {
                System.out.println("JDI error");
                return;
            Map<String, Connector.Argument> arguments = sac.defaultArguments();
            Connector.Argument hostArg = arguments.get("hostname");
            Connector.Argument portArg = arguments.get("port");
            hostArg.setValue(HOST);
            portArg.setValue(String.valueOf(PORT));
            vmMachine = sac.attach(arguments);
            List<ReferenceType> classesByName = vmMachine.classesByName(CLSNAME);
            if (classesByName == null || classesByName.size() == 0) {
                System.out.println("No class found");
                return;
            ReferenceType rt = classesByName.get(0);
            List<Method> methodsByName = rt.methodsByName(METHODNAME);
            if (methodsByName == null || methodsByName.size() == 0) {
                System.out.println("No method found");
                return;
            Method method = methodsByName.get(0);
    I will connect to server and monitor the remote server JVM , There is a object of User, I want to change its value by the Java Debugger Interface by client.
    so how to set its value by the client, and I can not got the User bean at client.
    I know the basic type filed value changed as follows:
    Value newValue = vmMachine.mirrorOf("change var value");// this field is a string.
    stackFrame.thisObject().setValue(field, newValue);
    But a Object , how can I change its value.
    Thanks Advanced.

    ObjectReference.setValue() is the method for chaining the value of an Object's field. First you need to find the specific Object you want to change, though.
    /Staffan

  • Alignment tool - how to set reference object?

    I am new to Flash but have used Illustrator and InDesign for years. I am wondering if someone can explain how to set the reference object by which all other objects are aligned; e.g. Illustrator ->select all objects then a second click on the reference object and all other objects take their cue.
    InDesign you lock the reference object and that determines the rest.
    In Flash it seems that either both objects move or the one that I wish to remain in position jumps rather than the other way around.
    Thanks

    I don't know if you can set a reference object in Flash.  I have always just followed the general rule of aligning into the direction where the alignment basis would not move... meaning if I am aligning to the left, then the leftmost item I would select would be the reference, and if need be I would move other objects to the right of it first.

  • How to set  an object in request scope in  a jsp uysing  jstl

    I usally use scriptlet in jsp to set an object in request is
    there a way to do this using jstl
    instead of this
    <%request.setAttribute("test",myObject);%> I want to use tag ?

    The <c:set> tag should be useful...
    Of course if you can access it as a JSTL variable it IS already an attribute in scope.

  • How to set default object placement & wrap for drag-and-dropped files

    I am working on a document into which I need to drag-and-drop a number of files from the Finder: JPGs, PDFs, and so on. Each time I drag a file into Pages, by default its placement is set as "Floating (doesn't move with text)" and "Object causes wrap" is active.
    I would much prefer that the default settings be "inline" and "object does not cause wrap," so my drag-and-dropped images will appear within the text and move with it.
    Is there a way to change this default setting?

    Niel's suggestion is good. You might also try posting your question in the Tiger Server forums. I'm sure Tiger Server has several ways of dealing with this.

  • How to set Link object type to grid column??

    Hello friends ,
                    I m using C# language. I want to set LinkedObjectType to the grid columns.So how can I set the Linked Obj type to the grid column?
    Reguards ,
      Mithun

    Hi,
    it should look like this.
    oGrid.Columns.Item(ColUID).Type = BoGridColumnType.gct_EditText;
    EditTextColumn col = (EditTextColumn)oGrid.Columns.Item(ColUID);
    col.LinkedObjectType = "2"; // Link to BusinessPartner
    lgDavid

  • How to set an object to 100% width now that Muse no longer has the button?

    I'm trying to set a slideshow to 100% width like the tutorials constantly talk about, but that is no longer possible in the latest version of Muse. The button is gone. So how do you do it? And why did Adobe remove the 100% width button? They seemed proud of it when it was released as a new feature.

    Hi,
    The 100% width option is available for the slideshow widget. But to use it in your slideshow, make sure you have selected the "Hero Image" of the slideshow and then click on the button of the 100% width option.
    Please refer to this screenshot :- http://prntscr.com/567j41
    Hope this helps
    Regards,
    Rohit Nair

  • How to set an object in attribute using tags

    Hello.
    I know you can do this <% request.setAttribute("someName", Object); %>
    But i am wondering if there is a jsp , jstl tag which can do the same thing? Also where I can give the scope.
    I would like to do something like this <jsp:someTag name="someName" value=${variable} scope="request" />
    Thanks in advance.

    I think you can use
    <c:set var="articleList" value="${advertises}" scope="session" />But this doesnt work. Any ideas?

  • How to set the Default values for Info Objects in Data Selection of InfoPac

    Hi All,
    Flat file Extracion:
    How to set the Default values for Info Objects in Data Selection Tab  for Info Package
    ex: Fiscal Year Variant  Info Object having values 'K4' 'Y2' etc  in Flat file
    Initially  default value(not constant)  for this info Object value should be 'K4'  in Info Package
    If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle
    Rgds,
    CV

    Hi,
    suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .
    haritha

  • How to set user preferred timezone in OBIEE for all objects.

    How to set user preferred timezone in OBIEE for all objects based on users TZ(may be from @{session.timeZone}). without changing My Account -> Preferences

    Check
    Time Zone Specification from http://docs.oracle.com/cd/E12844_01/doc/bip.1013/e12187/T421739T481157.htm#4535403
    just in case https://blogs.oracle.com/xmlpublisher/entry/how_to_keep_your_dates_from_go

  • How to set an array element in an object type of array??

    Hi,
    I have set attribute as follow:
    Color[] colors;
    Color[] colors = new Color[20];
    colors[0] = "Red";
    colors[1] = "blue";I can't compile this code. It said:
    "Incompatible type -found java.lang.String but expected Colors
    Could you tell me how to set an array elements when the array type is an object?

    in your case, the array shouldn't be Color[] but String[] since you re intending to put strings into it
    by the way, you could also use a hashmap to map a string to a color:
    HashMap<String, Color> hm = new HashMap<String, Color>();
    hm.put("Red", Color.RED);
    hm.put("Blue", Color.BLUE);
    etc.

  • How to set Where clause in the View Object of the MessageChoice ?

    Hi,
    How to set Where clause in the View Object of the
    MessageChoice ?
    Example:
    <bc4j:rootAppModuleDef name="EdEscolaCampusView1AppModule"
    definition="ed00050.Ed00050Module"
    releaseMode="stateful" >
    <bc4j:viewObjectDef name="EdEscolaCampusView1" >
    <bc4j:rowDef name="CreateEdEscolaCampusView1" autoCreate="true" >
    <bc4j:propertyKey name="key" />
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
    <bc4j:viewObjectDef name="ListaTipLocalView1"
    rangeSize="9999">
    </bc4j:viewObjectDef>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    messageChoice declaration:
    <bc4j:messageChoice name="SeqTipoLocalCampus"
    attrName="SeqTipoLocalCampus"
    prompt="Local do Campus">
    <contents>
    <bc4j:optionList attrName="SeqTipoBasico"
    textAttrName="NomTipoBasico"
    voName="ListaTipLocalView1"/>
    </contents>
    </bc4j:messageChoice>
    I would like set where clause of ViewObject, with dinamic parameters (using attribute1 = :1), before populate messageChoice.
    thanks...
    Danilo

    Hi Andy,
    I try set a where clause using the message:
    Set where Clause parameter using UIX , but my UIX Page have 2 messageChoice's of different ViewObject's, then I need implement this Java Class:
    //Nome da Package da Tela Detail
    package br.com.siadem.siaed.ed00050;
    // Importa as Bibliotecas necessárias
    import oracle.jbo.ViewObject;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.client.Configuration;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.data.jbo.servlet.bind.*;
    import oracle.cabo.ui.data.BoundValue;
    import oracle.cabo.ui.data.DataBoundValue;
    import javax.servlet.http.HttpServletRequest;
    import br.com.siadem.siaed.util.*;
    import javax.servlet.http.Cookie;
    import oracle.cabo.data.jbo.def.NestedAppModuleDef;
    import oracle.cabo.data.jbo.def.ViewObjectDef;
    import oracle.cabo.data.jbo.def.AppModuleDef;
    // Classe que configura os parametros para a execução da Query,
    // utilizando variáveis de Sessao
    public class FunPreQueryLista
    public static EventResult FunConfiguraQuery(BajaContext context, Page page, PageEvent event) throws Throwable
    // TrataDadosSessao - Classe utilizada para retornar os valores das variáveis de sessão genéricas
    // Ex: CodCliente, CodMunicipio etc...
    TrataDadosSessao varDadosSessao = new TrataDadosSessao();
    // 1o. Parametro Configurado - Através da classe TrataDadosSessao, utilizando um método Get
    // <alterar>
    String valor1 = varDadosSessao.getCodCliente();
    String valor2 = varDadosSessao.getCodMunicipio();
    //Cria o objeto que retorna o ApplicationModule
    ApplicationModule am = ServletBindingUtils.getApplicationModule(context);
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoLocal = am.findViewObject("ListaTipoLocalView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoLocal.setWhereClauseParam(0,valor1);
    TipoLocal.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoLocal.executeQuery();
    // Fim das Configurações da Query da Lista
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoDestLixo = am.findViewObject("ListaDestinoLixoView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoDestLixo.setWhereClauseParam(0,valor1);
    TipoDestLixo.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoDestLixo.executeQuery();
    // Fim das Configurações da Query da Lista
    // Retorna o Resultado para a Página
    return new EventResult(page);
    The code works very well...
    And, I'm sorry for my two repost's in UIX Forum about this in a few time.
    Thank very much...
    Danilo

  • How do you set default object settings

    I don't know how this happened but my default setting for object transparency got changed from "normal" to "color burn"
    (By selecting: Object - Effects - Transparency - then Color Burn or Normal) How can I switch this back so that the default is always on normal so I don't have to switch it from color burn to normal everytime I create a document?
    It took me an hour to figure out why objects were translucent. I kept thinking they were behind other objects and trying to bring them to the front, but they weren't. They were just set on color burn. I switched it back to mormal but everytime I start a new document, it defaults back to colr burn. Its driving me crazy.

    By the way, color burn is the default ONLY  when I draw cicles. If I draw a box, or any other shape the default is normal and works the way I want it to. Very odd.  Just a pain because everytime I draw a circle I gotta go through all these steps to set it back to normal so the colors don't burn through

  • How to set the selectedIndex when dataProvider is an XML object in DropDownList?

    dataProvider was an XML object
    How to set the selectedIndex when dataProvider is an XML object in DropDownList?
    I do this:
    <s:DropDownList id="dropDownList" requireSelection="true" selectedIndex="2"
                    labelField="lastName" dataProvider="{employeeService.lastResult.employees.employee}"/>
    But always the first item is selected whatever the value of selectedIndex equals to.

    if i understand correctly, you want the selectedindex to be 2 when the DropDownList  displays.
    It might be the case that the dataprovider is being sought after it's already selected its index (as the dataprovider isn't already determined to begin with), so currently it's
         - setting the selected index to default
         - setting the selected index to 2 (your command)
         - getting the dataprovider
         - setting the selected index to default
    try writing a function to set the DropDownList's selected index after it's received the information, or even just attach it to the employeeService result handler.
    for quick testing sake you could just add
    <s:DropDownList id="dropDownList" requireSelection="true" updateComplete="dropDownList.selectedIndex = 2"
                    labelField="lastName" dataProvider="{employeeService.lastResult.employees.employee}"/>
    to see if my theory is correct.

Maybe you are looking for