How to invoke action method from mail contained link

Hello,
my application needs to send mails to users that include links for the user to click on. Something like www.mysite.com/displayData.jsp&id=123. My question is now how I make JSF invoke the respective method in the backed bean to display the data with the id 123 when the user clicks on the link int the mail.
I wonder whether there is some kind of "catch-all action" that checks whether the user is logged in and authorized whenever any JSP page is invoked. I'm a bit tired of first checking the authorization of some user before processing the remaining part od the backed bean's action method.
Thanks for any hints,
Oliver Plohmann

my application needs to send mails to users that
include links for the user to click on. Something
like www.mysite.com/displayData.jsp&id=123. My
question is now how I make JSF invoke the respective
method in the backed bean to display the data with
the id 123 when the user clicks on the link int the
mail.I dont think there is a way to submit to an action on click of a link. Only possible solution is to invoke the method from the constructor of your Backing Bean and populate the bean fields displayed on your page.
I wonder whether there is some kind of "catch-all
action" that checks whether the user is logged in and
authorized whenever any JSP page is invoked. I'm a
bit tired of first checking the authorization of some
user before processing the remaining part od the
backed bean's action method. You can try out a Servlet filter for doing this.

Similar Messages

  • How to invoke Java method from C++

    Hi
    My requirement is In C++ we are having three different structures, like
    struct one{
    int accontno;
    char * accountholdername;
    long balance;
    struct two{
    int startdate;
    int enddate;
    struct three{
    char* userid;
    char* userpassword;
    from c++ how to pass these structures, these structures I have to read in Java class, and in java how receive these structures.
    And the sample methods will be like: getCarsData(Input, output, Error);
    How do i call the method in JNI, if it is static int method we can call like
    getStaticIntMethodID(), instead of int if i have to pass the above mentioned structures how do i do? Should i create an object array in JNI for accessing these three structures?
    Suggestions/Samples welcome
    Thanks,

    Why did you start another thread for this?
    I was answering you in the [url http://forum.java.sun.com/thread.jspa?threadID=712137&messageID=4119725#4119725]old thread and you didn't even bother to answer back my (basic) questions.
    I told you to use the code tags when pasting code. Got ignored. I also gave you a starting example on how to achieve your goal. Flushed.
    Oh well, I'm getting used to it.
    Again.
    Before starting, allways keep near you the [url http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html]JNI reference. All the JNI functions are documented in it.
    First you need to create custom Java classes that will match the C++ stucts (remember?).
    There is no magic wand in JNI that will transform the C++ structs into the custom Java classes and vice versa.
    You'll have to code it by hand, one field at a time. It's a pain.
    So for the one, two, three C++ structs (why not posting some real names instead of this crap?),
    there will be JOne, JTwo and JThree Java classes.
    There is also that other Java class already existing with getCarsData() static method that will fetch the data.
    And finally the DLL function wich will call this Java static method, doing the bridge between the C++ structs and the custom Java classes, finally return the data.
    Due to the lack of explanation from your posts, I will say that the getCarsData() static method receives a parameter of type JOne
    and returns an array of JTwo objects.
    So the get_cars_data() DLL function receives a parameter which is a struct one and
    returns a pointer to an array of struct two elements.
    // C++ structs
    struct one {
        int accontno;
        char * accountholdername;
        long balance;
    struct two {
        int startdate;
        int enddate;
    struct three {
        char * userid;
        char * userpassword;
    // custom Java classes
    class JOne {
        int accontno;
        String accountholdername;
        int balance;
    class JTwo {
        int startdate;
        int enddate;
    class JThree {
        String userid;
        String userpassword;
    // Java class with static method that gets the data
    class DataFetcher {
        static JTwo[] getCarsData(JOne one) {
    // DLL function
    // struct 'one' parameter is already filled with values.
    // Returns an array of 'two' C++ struct obtained from a Java static method
    two * get_cars_data(one o) {
        JNIEnv * env;
        /** not show here is the code to either
            create the JVM or
            attach it to the current thread **/
        // get the data from 'one' C++ struct and put it in a new instance of JOne Java class
        jclass oneCls = env->FindClass("JOne");
        jmethodID oneCtorID = env->GetMethodID(oneCls, "<init>", "()V");
        jfieldID accontnoID = env->GetFieldID(oneCls, "accontno", "I");
        jfieldID accountholdernameID = env->GetFieldID(oneCls, "accountholdername", "Ljava/lang/String;");
        jfieldID balanceID = env->GetFieldID(oneCls, "balance", "I");
        jobject oneObj = env->NewObject(oneCls, oneCtorID);
        env->SetIntField(oneObj, accontnoID, o.accontno);
        env->SetObjectField(oneObj, accountholdernameID, env->NewStringUTF((const char *)o.accountholdername));
        env->SetIntField(oneObj, balanceID, o.balanceo);
        // call the Java static method
        jclass dfCls = env->FindClass("DataFetcher");
        jmethodID getCarsDataID = env->GetStaticMethodID(dfCls, "getCarsData", "(LJOne;)[LJTwo;");
        jobjectarray twoArray = (jobjectarray)env->CallStaticObjectMethod(dfCls, getCarsDataID, oneObj);
        // create the 'two' C++ struct array from the Java array of JTwo objects
        jclass twoCls = env->FindClass("JTwo");
        jfieldID startdateID = env->GetFieldID(twoCls, "startdate", "I");
        jfieldID enddateID = env->GetFieldID(twoCls, "enddate", "I");
        jint len = env->GetArrayLength(twoArray);
        two * pt = new two[len];
        for (int i = 0; i < len; i++) {
            jobject twoObj = env->GetObjectArrayElement(twoArray, i);
            pt.startdate = env->GetIntField(twoObj, startdateID);
    pt[i].enddate = env->GetIntField(twoObj, enddateID);
    // return the resulting 'two' C++ struct array
    return pt;
    Regards

  • Invoke beanshell methods from java

    Hello
    I'm learning beanshell and using it to write scripts that are ran in JDK 6.
    My question is how to invok beanshell methods from java source codes.
    My codes is:
    import javax.script.*;
    public class InvokeFunctions {
    public static void main (String[] args)throws ScriptException, NoSuchMethodException
    ScriptEngineManager sem = new ScriptEngineManager();
    ScriptEngine bshEngine = sem.getEngineByName("beanshell");
    String script = "public void sayHello()"+"{print (\"sayHello() is a method in bsh script\");}";
    bshEngine.eval(script);
    Invocable inbshEngine = (Invocable)bshEngine;
    inbshEngine.invokeFunction("sayHello");
    I defined a method "sayHello()" using beanshell, but i just can't invoke it in Java.
    I got an error msg said:
    Exception in thread "main" java.lang.IllegalAccessError: tried to access method bsh.NameSpace.getThis(Lbsh/Interpreter;)Lbsh/This; from class bsh.engine.BshScriptEngine
    Any one has any idea about it?
    Thanks

    Look at the Javadoc documentation of IllegalAccessError. It says:
    Thrown if an application attempts to access or modify a field, or to call a method that it does not have access to.
    Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.
    Maybe recompiling all your sources (make sure you delete all existing *.class files) will help?

  • Adobe Configurator - how to invoke action or script from html widget?

    How to invoke action or script from html wiget in Adobe Configurator?
    Please help! I tried to make it about 5 hours!
    I need something like that:
    I click link or image
    ...and it runs action.
    Thanks!

    If you click on the question mark ( as shown below) on the right of Configurator  2 window
    the user guide installed on your computer within Configurator 2  will open
    Anyway once you have your action or script button  in your panel you must select it and configure it in the  inspector palette

  • Invoking java methods from C/C++ on the machine with different JREs

    I implemented Windows NT Service instantiating JVM and invoking several java methods. Everything works but I have an issue with running the service on the machine where multiple different versions of JRE have been installed. The service is calling java methods that require JRE 1.3 or later so I wrote the code that is setting system PATH from within the service based on the configuration stored in the external file. The problem is that the service requires jvm.dll to be in the PATH prior lunching it since this library is instantiated through the implicit linking. When I put jvm.dll in the same path as the service binary I can lunch it but JNI_CreateJavaVM fails and returns -1. This happens even if JRE 1.3 is in the system PATH prior lunching the service.
    Everything works if the system PATH contains references to JRE 1.3 and jvm.dll is removed from the service's directory.
    I am looking for an advice on what is the proper way to deal with invoking java methods from the C/C++ executable in the environment with different versions of JRE.
    Thanks, Kris.

    Here's a way I have done what you are asking about:
    What you want to do is make all of your linking happen at runtime, rather than at compile time. This way, you can edit the PATH variable before the jvm.dll gets loaded.
    Following is some code that I used to handle a dll of my own in this manner. You can decide if you want to write a "wrapper" dll, or if you find it simpler to approach the jvm.dll in this way.
    // Define pointer type for DLL entry point.
         typedef void JREPDLL_API (*EXECUTEREQUEST)(char*, Arguments&);
    // Set up path, load dll, and pass everything off to it.
    HINSTANCE javaServer = javaServer = LoadLibrary("jrepdll.dll");
    if (javaServer != NULL) {
    EXECUTEREQUEST executeRequest = (EXECUTEREQUEST)GetProcAddress(javaServer, "ExecuteRequest");
    if (executeRequest != NULL) {
    if (argc == 1)
         // Execute the request.
         executeRequest("-run", args);
    else
         // Execute the request.
         executeRequest("-console", args);
    Here's some code for how to edit the PATH:
              // Edit the PATH environment variable so that we use our private java.
    char *appendPt;
    char *newPath;
    char *path;
              char tmp[_MAX_PATH];
              // Get the current PATH variable setting.
    path = getenv("PATH");
              // Allocate space for an edited path setting.
              if (path != NULL)
                   newPath = (char*)malloc((_MAX_PATH * 2) + strlen(path));
              else
                   newPath = (char*)malloc((_MAX_PATH * 2));
              // Get upper part of path to desired directories.
              strcpy(tmp, filepath);
              appendPt = strstr(tmp, "dbin\\jreplicator");
              appendPt[0] = '\0';
    sprintf(newPath, "PATH=%sjava\\jre1.2.2\\bin;%sjava\\jre1.2.2\\bin\\classic", tmp, tmp);
    // Append the value of the existing PATH environment variable.
    // If there is anything, append it.
    if (path != NULL) {
         strcat(newPath, ";");
         strncat(newPath, path, (sizeof(newPath) - strlen(newPath) - 2));
    // Set new PATH value.
    _putenv(newPath);
              free(newPath);

  • Is it possible to invoke JEB method from thread?

    Hello everybody!
    I have problem creating EJB from the thread. Here is the part of code below:
    public void email() throws Exception {
    class MailThread implements Runnable {
    public MailThread() {
    public void run() {
    try {
    String jndiName "java:comp/env/ejb/PROG/Mail";
    IMailHome mailHome;
    IMail mail;
    InitialContext context = new InitialContext();
    Object objref = context.lookup(jndiName);
    mailHome = (IMailHome) PortableRemoteObject.narrow(objref, IMailHome.class);
    // Exception here:
    // java.rmi.RemoteException: Exception Substitute; nested exception is:
    // java.lang.NullPointerException mail = mailHome.create();
    // business metods
    // mail.method1();
    } catch (Exception e) {
    System.out.println("Exception:" + e);
    MailThread mt = new MailThread();
    Thread thread = new Thread(mt);
    thread.start();
    Exception:
    java.rmi.RemoteException: Exception Substitute; nested exception is:
    java.lang.NullPointerException
    I am not able to create EJB instance from the thread. The same code works well in servlet. Am I doing something wrong?
    May be there are some different approaches to implement some operations asynchronously at EJB level do not using JMS and MDB? J2EE specification prohibits to use threads inside EJB so the only way I see is to create different thread on servlet side and invoke EJB methods from it. But it seems that this doesn't work too. Could anyone help me?
    Thanks in advance,
    Vadim Lotarev

    If the passcode will not work, the only alternative is to restore the phone as new. You cannot change the passcode from the lock screen.

  • Question on "How-to invoke a method once upon application start"

    Hello everyone.
    I'm trying to implement what the article "How-to invoke a method once upon application start" by Frank suggests.
    https://blogs.oracle.com/jdevotnharvest/entry/how_to_invoke_a_method
    Suppose that I'm having a single point of entry, so in my login.jpsx I have the below:
    <f:view beforePhase="#{login.onBeforePhase}">In the method "onBeforePhase" I have to pass the phaseEvent, since the signature is the following:
    public void onBeforePhase(PhaseEvent phaseEvent)but how do I know the phaseEvent when calling the login.onBeforePhase? How the call should be?
    Thanks a lot!
    ps. I'm using jDev 11.1.2.1.0

    You need not pass anything to this method , this method will get called before every Phase except ReStore View
    Just write the logic as Frank suggested for the phase in which you want the code to execute. You can get the PhaseId's like
    PhaseId.RENDER_RESPONSE
    public void onBeforePhase(PhaseEvent phaseEvent) {// from Frank's doc
    //render response is called on an initial page request
      if(phaseEvent.getPhaseId() == PhaseId.RENDER_RESPONSE){
    ... etc

  • Problems invoking a method from a web service

    Am using netbeans 6.1 and my problem is when i invoke a method from a web service that has a custom class as a return type.
    When I debug the client that consumes my web service, It get Stack in this line:
    com.webservice.WebServiceInfoBean result = port.getWebServiceInfo(nameSpace, serviceName, portName, wsdlURL);
    i don't get any error on the console.
        static public void function1() {
            try { // Call Web Service Operation
                com.webservice.WebServiceMonitorService service = new com.webservice.WebServiceMonitorService();
                com.webservice.WebServiceMonitor port = service.getWebServiceMonitorPort();
                // TODO initialize WS operation arguments here
                java.lang.String nameSpace = "NameSpaceHere";
                java.lang.String serviceName = "WebServicePrueba";
                java.lang.String portName = "Soap";
                java.lang.String wsdlURL = "http://localhost/Prueba/WebServicePrueba.asmx?wsdl";
                // TODO process result here
                com.webservice.WebServiceInfoBean result = port.getWebServiceInfo(nameSpace, serviceName, portName, wsdlURL); // <--- here it stack
                System.out.println("getWebServiceInfo");
                Iterator i = result.getMethods().iterator();
                while (i.hasNext()) {
                    MethodBean method = (MethodBean) i.next();
                    System.out.print("Nombre: " + method.getname());
                    System.out.print(" Returns: " + method.getreturnType());
                    Iterator j = method.getparameters().iterator();
                    while (j.hasNext()) {
                        ParameterBean parameter = (ParameterBean) j.next();
                        System.out.print(" ParameterName: " + parameter.getname());
                        System.out.print(" ParameterType: " + parameter.gettype());
                    System.out.print("\n");
                    System.out.print(method.getfirma());
                    System.out.print("\n");
                    System.out.print("\n");
            } catch (Exception ex) {
                ex.printStackTrace();
        }Web Service side
         * Web service operation
        @WebMethod(operationName = "getWebServiceInfo")
        public WebServiceInfoBean getWebServiceInfo(@WebParam(name = "nameSpace")
        String nameSpace, @WebParam(name = "portName")
        String portName, @WebParam(name = "serviceName")
        String serviceName, @WebParam(name = "wsdlURL")
        String wsdlURL) throws Throwable {
            //TODO write your implementation code here:
            webservicemonitor instance = new webservicemonitor();
            return instance.getWebServiceInfo(nameSpace, serviceName, portName, wsdlURL);
        }I have tested my internal code from the web service side and everything works fine. The problem occurs when i invoke it from a client side. probably I did not made the right serialization form my class WebServiceInfoBean? or am missing something. here it is:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package com.beans;
    import java.util.ArrayList;
    * @author Tequila_Burp
    public class WebServiceInfoBean implements java.io.Serializable {
         * Holds value of property wsdlURL.
        private String wsdlURL;
         * Getter for property wsdlURL.
         * @return Value of property wsdlURL.
        public String getwsdlURL() {
            return this.wsdlURL;
         * Setter for property wsdlURL.
         * @param wsdlURL New value of property wsdlURL.
        public void setwsdlURL(String wsdlURL) {
            this.wsdlURL = wsdlURL;
         * Holds value of property namespace.
        private String namespace;
         * Getter for property namespace.
         * @return Value of property namespace.
        public String getnamespace() {
            return this.namespace;
         * Setter for property namespace.
         * @param namespace New value of property namespace.
        public void setnamespace(String namespace) {
            this.namespace = namespace;
         * Holds value of property serviceName.
        private String serviceName;
         * Getter for property serviceName.
         * @return Value of property serviceName.
        public String getserviceName() {
            return this.serviceName;
         * Setter for property serviceName.
         * @param serviceName New value of property serviceName.
        public void setserviceName(String serviceName) {
            this.serviceName = serviceName;
         * Holds value of property wsdlURL.
        private String portName;
         * Getter for property wsdlURL.
         * @return Value of property wsdlURL.
        public String getportName() {
            return this.portName;
         * Setter for property wsdlURL.
         * @param wsdlURL New value of property wsdlURL.
        public void setportName(String portName) {
            this.portName = portName;
         * Holds value of property methods.
        private ArrayList methods = new ArrayList();
         * Getter for property methods.
         * @return Value of property methods.
        public ArrayList getmethods() {
            return this.methods;
         * Setter for property methods.
         * @param methods New value of property methods.
        public void setmethods(ArrayList methods) {
            this.methods = methods;
        public MethodBean getMethod(int i) {
            return (MethodBean)methods.get(i);
    }by the way, everything has been worked on the same PC.

    Hi Paul,
    This sound familiar, but I cannot at the moment locate a reference to
    the issue. I would encourage you to seek the help of our super support
    team [1].
    Regards,
    Bruce
    [1]
    http://support.bea.com
    [email protected]
    Paul Merrigan wrote:
    >
    I'm trying to invoke a secure 8.1 web service from a 6.1 client application and keep getting rejected with the following message:
    Security Violation: User: '<anonymous>' has insufficient permission to access EJB:
    In the 6.1 client, I've established a WebServiceProxy and set the userName and password to the proper values, but I can't seem to get past the security.
    If there something special I need to do on either the 8.1 securing side or on the 6.1 accessing side to make this work?
    Any help would be GREATLY appreciated.

  • How to invoke crystal reports from Oracle forms 11g R2 along with passing p

    How to invoke crystal reports from Oracle forms 11g R2 along with passing parameter to it.
    how to pass parameters to crystal report, please help.

    how to pass parameters to crystal report, please help.This would entirely depend on crystal reports and you might find informations on crystal reports related communities more likely...I for one have seen crystal reports the last time about 12 years ago. And even back then I simply acknowledged it's existence instead of working with it.
    Maybe crystal reports can be invoked via a URL call which would make it simple as you'd need simply build an URL and show the report using web.show_document. But that's pure speculation. Also you might not be the first with this requirement, so the solution to your problem might be right under your nose and just a little google search away ;)
    cheers

  • How to call java method from workflow script?

    Hi
    I have a requirement of updating field value 'Document Status' based on review/approve of content from Workflow and hence need to update the version number. For that I need to call my java method from workflow during submit of review/approve condition. Please let me know how to call java method from workflow?
    Is there any alternative better way to achive this requirement from workflow? Please suggest.
    Thanks,
    Sarang

    OK. So, I think we can all conclude that you don't need to call any Java method, can't we? And, that wfUpdateMetadata is the command that will update your metadata.
    Now, the question is what are its arguments. It has two - the first is the name of a custom metadata field to be updated (let's suppose that one field is called xMinorVersion, and the other xMajorVersion), the other is the new value, e.g. <$wfUpdateMetaData("xMinorVersion", "New value.")$>As for new value - do you insist on using strings? Since you want to increase the value, it would be more convenient to work with numbers. For instance, with integers you could go with <$wfUpdateMetaData("xMinorVersion", xMinorVersion + 1)$>With strings you will need to convert it to numbers and back to strings. Besides, what happens if you have more than 100 minor versions? (you mentioned you want to add 0.01, but that would finally increase the major version, wouldn't it?) So, I think these two numbers are independent (perhaps, with exception that increase on the major version set the minor version to .00).
    If you want to present it, you can use profiles that will construct for you the representation 2.304 out of MajorVersion = 2, MinorVersion = 304
    Solved?

  • How to invoke java application from ABAP

    How to invoke java application from ABAP  ? Suppose I needto execute a EJB wihic is running on my SAP J2EE Enigne from an ABAP Program .
    Thanks,
    Manish

    Hi Manish,
    did you get some further documents concerning "abap program calls ejb"?
    If yes, could you please send me some informations.
    Thank you for your help.
    Kind regards, Patrick.

  • How to invoke a servlet from MDB

    Hi,
    Can someone please tell me how to invoke a servlet from MDB. Actually I want to have a MDB that will invoke a servlet that takes arround ~3 minutes to process and send the response back to MDB. Any small code snippet on invoking a servlet.
    Thanks

    nope. this is probably a bad design.
    but here's a hint: whenever you have a question like this, start browsing the javadocs. chances are there's a class that might help you.
    i'd recommend that you look at this:
    http://java.sun.com/javase/6/docs/api/java/net/HttpURLConnection.html
    %

  • How to invoke business process from sap xi?

    Hi...
    Please tell "How to invoke business process from SAP UI's."

    Hi...
    How to invoke business process from SAP UI's. (Eg: To trigger a process after creating an invoice)

  • HT6154 how to download the files from mail like gmail or yahoo or hotmail to my iphone 5s.I have not seen the option in my iphone 5s

    how to download the files from mail like gmail or yahoo or hotmail to my iphone 5s.I have not seen the option in my iphone 5s

    Download what files?
    What is the actual problem that is occurring?

  • How to invoke BPEL process from JAVA API

    Hi Guys
    Any idea if you can tell me how to invoke BPEL process from JAVA API ?
    What to do in BPEL process manager to achieve that?
    Regards
    Deepak

    See http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/invoke.htm#sthref1373 and the JavaDocs http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/toc.htm.

Maybe you are looking for

  • No Bluetooh Driver after upgrade to Win 8.1- HP Pavilion TS 11 Notebook PC

    Hello, I need help. When I bought this laptop it came with Win 8.0 and everything worked fine. But after the upgrade to win 8.1, the bluetooh crashed, and since there its not  recognized. I tried everythig even try to install the drive to win 8.0 but

  • Deploy adapter module in PI 7.1

    Hi everybody, I have made the changes to the module i developed in 7.0 as per stefnans blog /people/stefan.grube/blog/2008/12/11/adjust-your-pi-70-adapter-modules-for-pi-71-in-15-minutes Do i have to create the ear file and deploy it?..or is there so

  • Display Query View in WAD

    Hi, Anybody knows how to display the selected QUERY VIEW Description (i.e. in a text box) in a web template? (I know you can select a Query View in a drop down, so it should be possible!) Thanks, Max

  • My Z10 keeps dropping activesync password

    Hi there My Z10 keeps losing the password for my activesync account and I have to re-enter password many times throughout the day. This is a problem which grown steadily worse over the past two months. My other pop and imap accounts don't experience

  • Unable to set a property

    Hi, In my .jnlp file I'm trying to set a system property in the resources section, via: <property name="jnlp.aname" value="avalue" /> and in my code I am using System.out.println(System.getProperty("jnlp.aname")) and I am only getting 'null' for outp