Get the URL parameter in the Java code

Hi all

I have a strange problem. I have a JSF page with two controls:
-InputText
-Button

<? XML version = "1.0" encoding = "UTF - 8"? >
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< f: view xmlns:f = "http://java.sun.com/jsf/core" xmlns:af = "http://xmlns.oracle.com/adf/faces/rich" >
< af:document title = "view12.jsf" id = "d1" > "
< af:messages id = "m1" / >
< af:form id = "f1" >

< af:inputText label = "Label 1" id = "it98" value = "#{param.test}" editable = "always" / > "
< af:commandButton actionListener = "#{bindings.przekierowanie.execute}" = "przekierowanie" text "
Disabled = "#{!}" Bindings.przekierowanie.Enabled}"id ="cb1"/ >
< / af:form >
< / af:document >
< / f: view >


And I want to boot the InputText with URL parameter (param name is test - value = "#{param.test}" "). In the JSF page, all right. But after clicking on the button I want to read the value of InputText in Java Code, so I have URL:

http://127.0.0.1:7101/application6-ViewController-context-root/faces/view12.JSF?test=ASD

and my Java code that runs when clicking the button:

public String przekierowanie() {}
Map < String, String > map = FacesContext.getCurrentInstance () .getExternalContext () .getRequestParameterMap ();
String tttValue = map.get('zoom') ("test");
System.Err.println ("test:" + tttValue);
Returns a null value.
}

but it does not work... Whenever I get nothing when I click on the button. Could you tell me why and how to get the value of InputTex in my java function?

Store the parameter to a parameter of sight and access this setting from Java using EL code.
Here is the main part (without java code):
https://blogs.Oracle.com/Shay/entry/passing_parameters_to_an_adf_p

Tags: Java

Similar Questions

  • How can I get the exit code of a script .bat for Java back to PL/SQL?

    When you call a .bat script, only the exit code 1 returns. How can I get 7 back to the PL/SQL in the code example below?

    C:\Users\pwatson\src\java > type vv.sql

    set echo on

    -call dbms_java.grant_permission ('SYSTEM', 'SYS:java.io.FilePermission', '< < all FILES > >', 'run');

    HOME @EXIT/b ECHO 7 > vv.bat

    TYPE of HOST vv.bat

    CREATE OR REPLACE AND COMPILE THE SOURCES NAMED AS VV JAVA

    import of java.lang.Runtime;

    public class VV

    {

    public static int execute()

    survey java.io.IOException, java.lang.InterruptedException

    {

    int exitCode = 0;

    Duration rt = java.lang.Runtime.getRuntime ();

    Process proc = rt.exec ("cmd.exe /C v.bat 1 > NULL 2 > ZERO");

    proc.waitFor ();

    exitCode = proc.exitValue ();

    return exitCode;

    }

    }

    /

    CREATE OR REPLACE FUNCTION JavaRunShellCommand

    RETURN NUMBER

    IN THE JAVA LANGUAGE

    NAME 'VV.execute () return oracle.sql.NUMBER;

    /

    DISPLAY ERRORS

    NUMBER VARIABLE n;

    CALL JavaRunShellCommand() IN: n;

    PRINT n

    DISPLAY ERRORS

    SELECT JavaRunShellCommand() AS R FROM DUAL;

    DISPLAY ERRORS

    HOST DEL v.bat

    OUTPUT

    It is strange that there are no errors. If the Java code does not work, I would expect an exception. Without an exception in the code handler, I expect to be propagated all the way to the top of the call stack and be displayed by the client. But there is no exception.

    So that means, in my view, that there is nothing wrong with the code Java itself. He made the appeal successfully to run this external process. The fact that the external process falls down, is not an issue/error in Java.

    If this is the case, then the first thing that comes to mind, is that the Oracle (oracle.exe) process that is currently running, runs as a service of the o/s. And that the service will try to run a command through the command shell script. There may be a security or problem access here that prevents the oracle.exe running as a service to do this.

  • How to get the value on a model that is defined in the java code in email

    Hello

    I created a custom code and send email as well to custom component. I can send emails using the method:

    InternetFunctions.sendMailTo (EmailID, EmailTemplate, subject, cxt);

    But my problem is that I have to get a value in the model of "EmailTemplate" which are defined from java code. but I don't know how to get the value.

    I will highlight in the java code by using this code: binder.putLocal ("ErrorApproveRejectMsg", massegeBody);

    I'm trying to enhance the model using the code below, but not able to get.

    1 < $exec getValue ("#active", "ErrorApproveRejectMsg") $ >

    2 < $exec getValue ("#active", ErrorApproveRejectMsg) $ >

    3 < getValue ("ErrorApproveRejectMsg") $exec $ >

    4 < $exec getValue (ErrorApproveRejectMsg) $ >

    5 < getValue ("#local", ErrorApproveRejectMsg) $exec $ >

    6 < getValue ("#local", "ErrorApproveRejectMsg") $exec $ >

    7 < $ErrorApproveRejectMsg$ >

    8 < $exec ErrorApproveRejectMsg$ >

    Assuming that cxt will be your Service or execution context object

    You can do something like this

    DB. PutLocal ("ErrorApproveRejectMsg", "Error");

    cxt.setCachedObject ("DataBinder", db);

    PageMerger h = new PageMerger (db, cxt);

    cxt.setCachedObject ("PageMerger", h);

    InternetFunctions.sendMailTo (usersEmail, emailTemplate, emailSubject, cxt);

    where db is current databinder object, and you can put any variable custom in the workbook by using the putLocal method.

    Thank you

    Vikram

  • com.sun.messaging.jmq.admin.apps.broker.BrokerCmd failed to get the exit code of the child.

    I use D:\MessageQueue4_5\mq\bin\imqcmd.exe to get heads of JMS queues. In most of the facilities, I can retrieve the results without problem.

    At a single facility, however, I get an error when you try to run this command. Called with no arguments, it should display a list of available commands. But that's what I get instead:

    D:\utilities\imqChk > d:\MessageQueue4_5\mq\bin\imqcmd.exe

    Boot process failed.

    Could not run

    Java

    -cp

    d:\MessageQueue4_5\mq\lib\imqadmin.jar;

    d:\MessageQueue4_5\mq\lib\fscontext.jar

    -Dimq.home=d:\MessageQueue4_5\mq

    -Dimq.etchome=d:\MessageQueue4_5\mq\... \etc\mq

    com.sun.messaging.jmq.admin.apps.broker.BrokerCmd failed to get the exit code of the child.

    Other info:

    • Java is installed (version 1.7.0_17).
    • QBrowser using, I can sign in successfully and retrieve information from queue.
    • All of the named files and jar files are where they are supposed to be within the meaning of the doce above.

    I was not able to locate the source of the problem. Any ideas would be greatly appreciated.

    Thank you.

    I had this same problem and solved by editing the file \glassfish3\mq\etc\imqenv.conf manually by setting IMQ_DEFAULT_JAVAHOME as follows:

    IMQ_DEFAULT_JAVAHOME = / Files/Java/jdk1.7.0_45 program

    Note the orientation of the slash. It's on Windows, and when I used with Windows style slash escape sequence, it does not solve this problem only when I used the mangled Unix style done.

    Hope this helps,

    -Noah

  • where can I get the source code for the shell of the user interface

    Hi all
    I use Jdeveloper 11.1.2.3.0 shell and UI.
    I want to show a custom message to the user when it tries to close a tab that contains unsaved data.
    I found this thread {message identifier: = 10782288}
    I tried to extract the contents of the oracle-page-templates file - ext.jar, but I find only the .class files not .java files.
    So, where can I get the source code for the shell of the user interface, or someone has a better solution?

    Hello

    Try this link http://www.oracle.com/technetwork/developer-tools/adf/uishellsrc-1612278.zip

    Frank

  • Where to put the java code - best practices

    Hello. I work with the Jdeveloper 11.2.2. I'm trying to understand the best practices for where to put the code. After reviewing the http://docs.oracle.com/cd/E26098_01/web.1112/e16182.pdf, it seemed that request module was the preferred location (although many examples in the pdf file reside in the main methods). After some time of coding, if, I noticed that there was a certain libraries imported and wondered if this would impact performance.

    I looked at the articles published on the forum, in particular Re: programmatically access the method of service (customer interface) . This link mentions for access to the code a bean of support - and the bulk of the recommendations seem to be using the data control to drag to the Joint Strike Fighter, or use the links to access code.

    My interest lies in where to put the java code in the first place; In the view object, entity object, and... other Am, backing bean object?

    I can describe several guess better know where to put the code and the advantages and disadvantages:

    1. in the application module
    Benefits: Central location for code makes development and support easier as there are not multiple access points. Kinda like a data control centralizes the services, the module of the application can act as a conduit for the different parts of the code you have in your model objects.
    Cons: Everything in one place means that the module of the application becomes bloated. I don't know how the memory works in java - if the app module has tons of different libraries are all called when even a method of re - run a simple query is called? Memory of pigs?

    2. write the code in the objects it affects. If you write code that accesses a view object, write it to a display object. Then make it visible for the customer.
    benefits: the code is accessible through ducts less (for example, I expect that if you call the module from the application of a JSF backing bean, then the module of the application calls the view object, you have three different pieces of code-)
    CONT: the code gets spread, more difficult to locate etc.

    I would greatly appreciate your thought on the issue.


    Kind regards
    Stuart

    Published by: Stuart Fleming on May 20, 2012 05:25

    Published by: Stuart Fleming on May 20, 2012 05:27

    First point here is when you say 'where to put the code of java' and you're referring to ADF BC, the point is that you put 'code of java business logic' in the ADF business components. Of course it is very good to have the Java code in the ViewController layer that covers the user interface layer. Just don't put the business logic in the user interface layer and don't put no logical user interface in the model layer. In your 2 examples you seem to consider the ADF BC layer only, so I'll assume that you're not only serious logic java code.

    Meanwhile, I'm not keen on best practices in the term that people are following best practices without thinking, usually best practices come with conditions and forget to apply. Fortunately you do not here that you have thought through the pros and cons of each (nice work).

    Anyway, back on topic and turn off my soap box, regarding where to put your code, my thoughts:

    (1) If you have only 1 or 2 methods set in the AppModuleImpl

    (2) If you have hundreds of methods, or there is that a chance #1 above will turn into #2, divide the code between the AppModuleImpl, the ViewImpl and the ViewRowImpls. Why? Because your AM will become overloaded with hundreds of methods making it unreadable. Put the code where it should logically go instead. Methods that operate on a specific line of VO Approfondissez partner ViewRowImpl, methods that work across lines in a VO enter the ViewImpl and methods that work throughout your in the associated AppModuleImpl.

    To be honest that you never the option you choose, one thing I recommend as a best practice is to be consistent and document standard so not know your other programmers.

    BTW, it is not a question about loading a lot of libraries/imports in a class, it has no performance cost. However if your methods require a lot of class variables, then yes there will be a memory of the costs.

    On a side note, if you are interested in more ideas on how to create ADF applications properly think about joining the EMG "ADF", a forum which deals with ADF architecture, best practices (cough), deployment architectures free online and more.

    Kind regards

    CM.

  • Y at - it an easy way to get the sql code that is sent in the query UPDATE

    I have a request to UPDATE abbreviated for readability. Is there an easy way to get the sql code that is sent? I use get this info for sql select in the display of debugging in cfeclipse but not for the UPDATE.

    < cfquery debug = "" name = "q" datasource = "#datasource #" > "



    UPDATE [BookingSystem]. [dbo]. [tbTrades]
    SET
    [Status] = #MATCHED_STATUS #.
    WHERE

    clientID = < cfqueryparam value = "" #arguments.clientID # "cfsqltype ="cf_sql_integer"> AND"

    < / cfquery >

    It might pay to read the docs for - http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_p-q_17.html#1102316 - focusing on the RESULT parameter.

    Read also about debugging in CF: http://livedocs.adobe.com/coldfusion/8/htmldocs/Debug_01.html

    --

    Adam

  • OfficeJet HP6500A more: can't stop e-Print to get the claim Code

    HP support says "disable e-print and deliver on the clain code obtaion" I can't disable e-print! When I try I get a message saying 'the printer could not connect to server' error 'you can connect the printer to a proxy through the internet' "to do so enter the proxy server and enter the details when you are prompted" MY QUESTION: WHAT PROXY SERVER? Where can I find the so-called proxy server. I can not turn off the e-print without mysterious proxy server. Nobody at HP Support knows, they want to come on my computer. HOW THAT WILL HELP, IF I HAVE TO GO IN THROUGH THE PRINTER? I'm not let someone remote my computer! I've done it before and all they do is look around where they don't belong, then tell me "I have a friend who can fix it for $200.00" BS! I just want to know how to get the claim code so I can use e-print. This may not be such a mystery that emit a person cannot tell me by phone or e-mail, how can I recover the claim code. OR, where I can find this mysterious Proxy Server turns off e-print, so I can turn it on the recovery of the claim code.  PLEASE DO NOT SEND ME LINKS OF WHERE ALL THE ANSWER OF WHAT IS CALLED, IT IS HERE, I HAVE ALREADY DID NOT RESEARCH DAYS, JUST GIVE ME ANSWERS TO MY QUESTION *.

    WHAT PROXY SERVER? Where can I find this so-called proxy server!

    Hello

    First download and install the latest firmware below, then check for the difference:

    http://ftp.HP.com/pub/softlib/software13/Printers/oj6500/OJ6500_E710n-z_R1621A.exe

    Once the latest firmware has been installed check for the difference once the HP ePrint menu.

    If the same error persists, press the right arrow and press Setup, then Web Services configuration tab.

    Tap on delete Web Services and follow the steps to the web services of devil.

    Then enter the menu of Web Services again and follow the instructions on the screen to reactivate the service and check for the difference.

  • I'm unable to get the registration code for my Blu - Ray player

    I'm unable to get the registration code for my Blu - Ray player. I followed the instructions and all I get is the statement: device is registered. I can't register for the most part without a valid code. Please let me know how I can get the correct code. Thank you

    If you were able to enter the registration code the first time you tried to save the player before then you don't need to do it again. Just bought this drive? If so, was it a screen or mixed open-box model?

  • How can I get the registration code to my KDL-40W600B?

    Just like the title says, I have a new KDL-40W600B and have need the code of registration for some of the apps I would like to use. Instructions for a pop - up on the Web of Sony Essentials page is as follows: to get the Registration Code please make sure that your active internet BRAVIA TV is connected to your network, powered and active. Press the Home button on your remote control and access the network icon in the Xross Media Bar. Scroll to activate enhanced features and select it by pressing on enter. Look for the Registration Code to your BRAVIA TV. Evil.

    Hi jeansebastienhamet!

  • When you drag the file on the external drive I get the error code-43? What it means? How to fix? Thank you!

    When you drag the file on the external drive I get the error code-43? What it means? How to fix? Thank you!

    Restart the computer and try again.

  • get the error code 1429 (I can't restore my shuffle gen 4)

    I can't restore my shuffle gen 4 (I get the error code 1429)

    Suffle stopped mid-song and don't retart

    A Reset (reboot) for a shuffle is to set the switch OFF for at least 10 seconds.

    If you are able to start a restore through iTunes, which must mean that the shuffle still appears in iTunes when connected.  It is the Apple document with tips for this error.

    If you see the error 1415, 1417, 1418, 1428, 1429, 1430, 1436 or 1439 during restore or update iPod in iTunes - Apple...

    If this does not help, please report back.

  • In Safari, I get the error code BSO D 0 X 80060402, error code Windows defender in the available boot device. He told me to contact Microsoft certified technicians. I do not use Microsoft or windows.

    In Safari, I get the error code BSOD 0 X 80060402, error code Windows defender in the available boot device. He told me to contact Microsoft certified technicians. I do not use Microsoft or windows.

    You have utilities installed on the computer antivirus, cleanup, or other third party maintenance?

  • Get the Ascii code of a string

    Hi all

    I need to get the ascii code of a character, and I can't find the appropriate function to do.

    For example, I get a string like this :--> 'X 6T8OP' and I want to turn it into this: 54 84 56 79 80 32 88

    Note: I'm using Labview 8.2

    Well thanks to all!

    Salvation of output,

    Use the function "string into byte array.

    Mike

  • How can I get the color codes for the notebook

    How can I get the color codes for the notebook?

    Hello

    What is the color codes for the notebook?

    Perhaps you need a 3rd party utility like GetDiz - Free and others to be
    found using BING or Google.

    GetDiz Notepad - free - replacement
    http://www.Outertech.com/en/Notepad-replacement

    I hope this helps.

  • "WindowsUpdate_00000646" "WindowsUpdate_dt000": it is to get the error code. Don't let me download updates

    I get the error code when you try to download updates

    If the updates in question are updates of security for Office, see - error 646 when installing updates
    Please note a Fixit available here if these updates are updated Office -code error '0 x 80070646', '646', or '1606' when you try to install the Office updates

    If the updates in question are not for the office, so please read this and post back to this topic with the requested information so that someone peut help -.
    What information to post in the Windows Update forum

    Expert MowGreen Windows IT Pro - consumer safety

Maybe you are looking for