Access to a link from within a servlet
Hey all,.If I try to access a link from a servlet instead of use the ApplicationModule approach which is recognized as a bad idea (http://blogs.oracle.com/jdevotnharvest/2010/11/when_to_use_createrootapplicationmodule_in_oracle_adf.html). However, when the code runs in servlet line BindingContent.getCurrentBindingsEntry () returns null. I think that there is something missing in my setup which is originally ADFm to not recognize the servlet as having a binding file. Something stand out?
So within a servlet, I have the following:
SerializableAttribute public class RSSNewsServlet extends HttpServlet {}
public void doGet (HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {}
BindingContext bctx = BindingContext.getCurrent ();
BindingContainer links = bctx.getCurrentBindingsEntry ();
DCBindingContainer bindingsImpl = (DCBindingContainer) links;
DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("AllPapers1Iterator");
Rank [] rows = dciter.getAllRowsInRange ();
...
}
}
Web.XML:
< filter mapping >
< filter-name > adfBindings < / filter-name >
< name servlet - > NewsServlet < / servlet-name >
< name servlet - > Faces Servlet < / servlet-name >
< distributor > BEFORE < / dispatcher >
< distributor > APPLICATION < / dispatcher >
< / filter-mapping >
....
< servlet >
< name servlet - > NewsServlet < / servlet-name >
< servlet-class > < servlet path >. RSSNewsServlet < / servlet-class >
< / servlet >
...
< servlet-mapping >
< name servlet - > NewsServlet < / servlet-name >
/servlet/news.RSS < url-pattern > < / url-pattern >
< / servlet-mapping >
newsServletPageDef.xml:
<? XML version = "1.0" encoding = "UTF-8"? >
< pageDefinition xmlns = "http://xmlns.oracle.com/adfm/uimodel."
version = "11.1.1.56.60" id = "newsServletPageDef".
Package = "< path pagedefs > pageDefs" >
< Settings / >
<>executables
< variableIterator id = "variables" / >
< iterator lie = "AllPapers1" RangeSize = "25".
DataControl = "GatewayNewsAppModuleDataControl."
ID = "AllPapers1Iterator" / >
< / executables >
< links >
< Tree IterBinding = "AllPapers1Iterator" id = "AllPapers1" >
< nodeDefinition DefName = "< path-to-model > AllPapers.
Name = "AllPapers10" >
< AttrNames >
< point Value = "PapId" / >
< point Value = "PapTitle" / >
< point Value = "PapPublishDate" / >
< point Value = "PapExpireDate" / >
< point Value = "PapAuthor" / >
< point Value = "PapType" / >
< point Value = "PapIssueDate" / >
< point Value = "PapFileName" / >
< point Value = "PapUserName" / >
< point Value = "PapPostedDate" / >
< point Value = "PapModifiedDate" / >
< point Value = "PapNeverExpire" / >
< point Value = "PapFile" / >
< / AttrNames >
< / nodeDefinition >
< / tree >
< / links >
< / pageDefinition >
DataBindings.cpx:
< pageMap >
...
"< path="/servlet/news.rss page "usageId ="MyAlmacTemplate_view_newsServletPageDef"/ >
...
< / pageMap >
< pageDefinitionUsages >
...
< page id = "MyAlmacTemplate_view_newsServletPageDef".
path = "com. Almac.Aurora.Gateway.pageDefs.newsServletPageDef"/ >
...
< / pageDefinitionUsages >
When the code runs in servlet line BindingContent.getCurrentBindingsEntry () returns null.
The BindingContext.getCurrentBindingsEntry () method returns the requestScope variable with key "bindings". When using ADF Faces, this variable is set during model prepare ADF Faces (by the method of PageLifecycleImpl.prepareModel ()). But when you use a simple servlet that variable is not set (because the lifecycle page ADF Faces is not running) and this is the reason why you get a null result. To work around the problem, you can use the following code in your servlet:
BindingContext bctx = BindingContext.getCurrent();
DCBindingContainer pagedef = bctx.findBindingContainerByPath(request.getServletPath());
bctx.setCurrentBindingsEntry(pagedef); // Invoke this method only if for some reason you need the "bindings" variable set in the environment
Dimitar
Tags: Java
Similar Questions
-
VPN clients are unable to access sites that are above a link from site to site
could someone please give me some direction, I have a set of vpn clients set up on a pix and I'm trying to give them access to a network that is connected via a link from a site that is set up on the same pix. so, basically, that it receives information from VPN client on the same interface, it built the tunnel from site to site, I've heard that's not possible is that the case. Or it can be fixed, I can provide diagrams and if necessary conf files.
You are right. You need a minimum of 7.0 for the feature you're looking for.
Kind regards
Arul
* Please note all useful messages *.
-
Clean removes the links from Safari to docking station
New to Apple. I created links from Safari into the dock for easy access for example, The Guardian. When I run a utility such as Dr. Cleaner cleaning, it deletes the link and I get an exclamation mark on the icon. Can I stop this behavior or create my links another way?
nullifidian1945 wrote:
Can I stop this behavior or create my links another way?
Yes. Uninstall Cleaner Dr.
-
Adblock Plus is originally an extra window open when I click on a link from Apple Mail.
When I click on a link from Apple Mail, an (empty) additional window opens. The problem seems to be related with Adblock Plus, because it happens when Adblock Plus is removed. Problem, all started yesterday (7/29).
This only happens with AdBlock? Very strange. AdBlock to block pop-ups.
Is there anything in the address of this window box?
It's on a website, several? -
Firefox does not open links from thunderbird link
I get a message that firefox is already open but not answer, I have to close and Open firefox and it works only once. If I copy / paste link from thunderbird he opens it.
I don't know, but it may have started when I got a update "tab mix more... I remember even having label mix more? Unless it came with firefox.
You need to open an instance of Firefox without using the - No.-remote command line switch and don't use this switch to open additional instances of Firefox.
Then you can open a link in an external application using this first instance of Firefox which started without - No.-remote. -
I want to be able to open links from other applications, such as my email client or the Office Word, Excel, etc., in a NEW TAB in FF v11, AND AT SAME TIME, and by default, be able to open links clicked of in FF (entire page Web or tab) in the SAME TAB AS THE LINK, unless I do a right-click and choose 'Open link in a new tab' or 'Window '. Is this possible? This action/behavior should be an option in the 'options' or settings. If it is already, then it is poorly defined or marked as to what action, it's that the setting doesn't.
You can set the integer pref browser.link.open_newwindow.override.external '1' on the topic: config page.
The pref browser.link.open_newwindow.override.external uses the same values as this pref for calls JavaScript window. Open ().
-
Opening links in a new tab will also load the link on the problem of temporamental currnt tab that comes and goes. Sometimes using links from google as well. Never had this problem before. Also the SafeSearch feature on google has itself locked on strict, not too much problem, but has happened at the same time my links and tabs not working like I want.
Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).
- Makes no changes on the start safe mode window.
- https://support.Mozilla.org/KB/safe+mode
-
How to configure firefox to run as a single instance, so that all external links open within my existing window rather than opening another window?
Sorry, there is no setting for what is built into Firefox.
https://addons.Mozilla.org/en-us/Firefox/addon/tab-utilities/
In the utilities tab > Options > links there is a preference to enable single window mode. -
Firefox opens, but this morning, I can't access all the links via Firefox. I can through Explorer.
One possible cause is security software (firewall) that blocks or limits Firefox or plugin-container process without informing you, possibly after the detection of changes (update) for the Firefox program.
Delete all rules for Firefox in the list of permissions in the firewall and leave your firewall again ask permission to get full unlimited access to the internet for Firefox and the plugin-container and the update process.
See:
-
I tried to open a Web site as a link from another site and I get a new tab that says:
awclick.php (the Image GIF 1 x 1 pixels)
I can open the Web site without clicking on a link to it simply by typing the address, but as this is a cashback site that I'm the link it does not help!
Hiya,
I don't get a GIF as Bodspice mentioned above, but I'm left with a blank page that has the following URL:
I use Windows XP and Avast firewall as an anti-virus.
I tested it on Chrome, it took me to the page immediately without any problem.
No idea why and how to get rid of this problem? I'm not keen on the use of Chrome and prefer Firefox.
Thanks in advance.
-
How can I access the App Store from iTunes on my laptop? (NOT my phone).
How can I access the App Store from iTunes on my laptop? (NOT my phone).
Hello
In iTunes, click on the Apps icon on the top left and an "App Store" button will show more to the right.
-
Cannot remove applications or links from the Launcher
Ok. I ran into a problem with my Pre... I added a touch of the Launcher, but now I can not remove the link. It is something that will have to change. I really want the option to delete the links in the Launcher. Also pages adding additional Launcher would be nice too.
If someone could remove links from the launcher and then let me know.
Hold down the orange key on the keyboard while clicking on the link in the Launcher.
-
Unable to print an invoice from within a Web page.
Original title: device error message
Unable to print an invoice from within a Web page.
using network printer.
Hi ColinBall,
1. are you able to print other Web pages and other documents?
2. you receive messages or error codes?
If you are facing the issue when you try to print from Internet Explorer, you can read the following article and see if it helps.
I can't print or preview before printing a Web page in Internet Explorer
Hope this information is useful.
-
When you reply to a post in a salon political discussion of yahoo, I suddenly get the message... you have been disconnected from the chat because you have accessed YAHOO! MESSENGER from another computer or device. I did not as far as I know? Thank you, Charles
Hello
The message "you have disconnected because you access Yahoo! Messenger from another computer or device." appears when you try to connect twice with the same Yahoo! ID. Someone knows your password and he at the same time connecting with you or you have Yahoo Multi Messenger and accidentally logging in twice. One solution is to change your Yahoo! password or not to use Yahoo Multi Messenger with the same ID.
Good luck!
-
I can't access my memory card from my computer
I can't access my memory card from my computer
Hi wcuny,
Glad to hear that you guessed it work. You can mark the post as solved so others that this thread can see what you did to do the repair?
Maybe you are looking for
-
Equium M50 - touchpad using Win XP home problem
Equium M50 sm59E with XP home I went from just good to an optional update to idéacom windows knocking out my touchpad and keyboard (many other people did the same thing and there is a growing army of us more) I've resorted to a new installation I've
-
Why my notes on my iPhone and iPad are no longer synchronized on my Mac
Why my notes on my iPhone and iPad are no longer synchronized on my Mac?
-
computer fails to install the hardware device connected to USB
computer recognizes the new device but said device is configured incorrectly (code i1) It does not install the driver for the device. The USB port works OK with a mouse and a printer. It will not install the items include a wireless, software modem m
-
Printer Spooler service is over. Impossible to acquire again by restarting
How can I restart Printer Spooler service?
-
Where and how to find the wep or wpa security key?
I am trying to go to Xbox 360 live. I bought a direct card and it worked fine after that I entered the subscription on the map code. The next day, I was unable to sign. I have tried everything I know, but now he wants my wep or wpa security key. I di