Accessing View Object Information from JSP
Hi!
I know that my question it's a basic one, but I'm having some problems. Let me start by describing my problem.
I need to implement an navigation select box to one table (this table will be a result of a query). I'm "building" the select box with a <c:forEach> iterator. Well, the problem starts where:
<%-- Makes a kind of Math.ceil(double) --%>
<c:set var="resultInDouble" value="${(binding.estimatedRowCount-1)/binding.rangeSize +1}" />
<c:set var="resultInDoubleZero" value="${resultInDouble - resultInDouble % 1}"/>
<fmt:formatNumber value="${resultInDoubleZero}" var="resultInt" pattern="0"/>
<select name="select" >
<c:forEach var="SelectBoxItems" begin="1" end="${resultInt}">
</c:forEach>
</select>
As you can see, first I need to calculate the number of "<option> ... </option" I need to put on the select box, and I do that by making an ceil method emulation (for those that doesn't know ceil, it rounds up a division, like 7/3 = 3). To do this ceil I need to call the estimatedRowCount. And that's the problem: when I call estimatedRowCount, the query that I previous made is repeated to calculate the numberOfRows returned. As you can imagine, I don't want to re-execute the query, but only get the number of all rows.
One solution that I thought, was in the Java Controller File for this page, use the method associated with the ViewObject getRowCount(), that doesn't re-execute the query. With this idea, I would construct the select box with java code, something like this:
<select name="select" >
<%
int ceilResult = Math.ceil(viewObject.getRowCount(),viewObject.getRangeSize());
for (i = 0;i<ceilResult;i++) {
%>
<option> ... </option>
<% } %>
</select>
But with this idea, I hanged with a problem: "How do I in JSP, can "see" the view object?".
Basically i only need a small example source, that in Java Controller File can get the iterator to make the return of the ViewObject getRowCount method.
Does anyone have any idea how to solve this problem, or maybe a new approach ?
Tiago Soares
P.S. I've already tried some others (attempts of) solutions, but they didn't worked. I didn't posted their description, because I was afraid that anyone would read this post, because of the size of it. :)
First of all, please stop reposting this question. Post it once and someone will probably reply to it.
Secondly, you can expose methods of a view object through it's dialog (I think) or you will have to do it in the Application Module.. But it may suit your need better to create a transient column on you VO (one that exists only in memory) and store your value in that.
Similar Messages
-
Accessing view object class (impl) method from bean (or vice versa)
Halo everyone, I am using JDeveloper 11.1.2.1.0
I have a UsersViewImpl class with a method which refresh the user table like below.
public void resetEmployeeSearch() {
removeApplyViewCriteriaName("viewCriteria");
executeQuery();
and I have a UserBean class with a method which reset the search fields values like below.
public void resetInput(ActionEvent actionEvent) {
........RichInputText = input ...
input.setValue("");
AdfFacesContext.getCurrentInstance().addPartialTarget(searchForm);
I would like to implement it in such a way that, once I press a button, both methods will be called.
I have tried to call from bean method using UsersViewImpl vs = new UsersViewImpl ..... which is wrong and wont work.
I have read about doing something like ViewObject vo = am.findViewObject("DeptView1") but I duno how to use it because I cant have a proper example.
Any suggestion on accessing view object class (impl) method from bean (or vice versa)?
Or is there any way to combine both method in the same class ?
Thank you :(User, if you get class not found exceptions you need to tell us which classes you can't find. The JSFUtils and ADFUtils classes needing some other libraries which should already be part of your Fusion Web Application template (which your adf application should be based on). If you did not use this application template, you may have to add some libraries yourself.
What is the diff of using the ADFUtils and OperationBinding way?
The ADFUtils can get you access to the application module which you then use to call exposed methods on. The disadvantage of doing this is that you have to implement your own exception framework which then handles exceptions thrown by the application module. An other thing is that if you e.g. alter a VO which you use on the page this changes are not seen on the page until you refresh the page. The binding layer does not know about these changes so the iterators (which are used on the page to show the data) are not refreshed and so you don't see the changes.
In general you should avoid using the application modul in a managed bean method and always use the binding layer (OperationBinding) to call methods. This ensures that exceptions are all handled the same way and that changes to the data model are reflected in the GUI.
Timo -
Access the object array from client.
I'm trying to access the object array from client.
it's throwing the following error,
RemoteException Ocuredjava.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.MarshalException: CORBA BAD_PARAM 0x4f4d0006 Maybe; nested exception is:
java.io.NotSerializableException: oracle.jdbc.driver.OracleResultSetImpl is not serializable
how to resolve it?
thanx in advance,
Ilam.Don't send a ResultSet back as the result of an RMI call. Extract the data from the ResultSet on the server and send that back instead.
-
The syntax for accessing MS SQL db from JSP
Can anybody help me with the syntax for accessing MS SQL db from JSP???
This is what I do when I use MySQL:
Class.forName( "org.gjt.mm.mysql.Driver" );
Connection conn = DriverManager.getConnection(
"jdbc:mysql:://um" ,
What do I write when it is MS SQL and where do I install the driver
BR SorenCan anybody help me with the syntax for accessing MS
SQL db from JSP???
This is what I do when I use MySQL:
Class.forName( "org.gjt.mm.mysql.Driver" );
Connection conn = DriverManager.getConnection(
"jdbc:mysql:://um" ,
What do I write when it is MS SQL and where do I
install the driver
BR Soren
One way of doing this is to use ODBC. Here's an example:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection("jdbc:odbc:<odbc name>", "<login>", "<password>"); -
URGENT: Insert multiple rows in a view object cache from the same Page
Please let me know whether I can get insert multiple rows in the same view object from a single page.
I'm using UIX on Jdeveloper 9.0.5.2
Thanks a lot.Hi,
please check Duncan Mills how-to on this
http://www.oracle.com/technology/products/jdev/tips/mills/JSP_Multi_Row_Edits.html
Frank -
Create View Object programattically from XML input
Hi,
I have requirement to create view object from xml at run time in ADF application. is there any way to create view object dynamically in java program from xml?
My requirement is to call a webservice and generate view object from the response of the web service call.
ThanksI want to create view objects from different web services and the same will be available to the developer at the time of development. I don't want to create web service proxies for each of the web service. this will simplify the developers task to create proxy and data controls. the one thing developer has to do is select the service and base on the service the view objects will be created to develop pages accordingly.
-
Access Content Space docs from JSP!
Hi,
How do I access PDF docs in contentSpace from JSP page?
Regards,
SrujanDetail error code is
ALC-CSV-30101-000:
com.adobe.livecycle.contentservices.client.exceptions.CSInvalidParameterException: ALC-CSV-030-101-Invalid or No Store specified while invoking [retrieveContent].at com.adobe.livecycle.contentservices.dsc.impl.DocumentManagementServiceImpl.retrieveConten t(
DocumentManagementServiceImpl.java:444)at sun.reflect.GeneratedMethodAccessor2455.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(
Method.java:597)at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(
DefaultPOJOInvokerImpl.java:118)at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(
InvocationInterceptor.java:140)at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(
RequestInterceptorChainImpl.java:60)at com.adobe.idp.dsc.interceptor.impl.DocumentPassivationInterceptor.intercept(
DocumentPassivationInterceptor.java:53)at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(
RequestInterceptorChainImpl.java:60)at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(
TransactionInterceptor.java:74)at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(
EjbTransactionCMTAdapterBean.java:357)at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(
EjbTransactionCMTAdapterBean.java:227)at sun.reflect.GeneratedMethodAccessor777.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(
Method.java:597)at org.jboss.invocation.Invocation.performCall(
Invocation.java:359)at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(
StatelessSessionContainer.java:237)at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(
CachedConnectionInterceptor.java:158)at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(
StatelessSessionInstanceInterceptor.java:169)at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(
CallValidationInterceptor.java:63)at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(
AbstractTxInterceptor.java:121)at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(
TxInterceptorCMT.java:378)at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(
TxInterceptorCMT.java:181)at org.jboss.ejb.plugins.SecurityInterceptor.invoke(
SecurityInterceptor.java:168)at org.jboss.ejb.plugins.LogInterceptor.invoke(
LogInterceptor.java:205)at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(
ProxyFactoryFinderInterceptor.java:138)at org.jboss.ejb.SessionContainer.internalInvoke(
SessionContainer.java:648)at org.jboss.ejb.Container.invoke(
Container.java:960)at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(
BaseLocalProxyFactory.java:430)at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(
StatelessSessionProxy.java:103)at $Proxy401.doSupports(Unknown Source)
at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(
EjbTransactionProvider.java:104)at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(
TransactionInterceptor.java:72)at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(
RequestInterceptorChainImpl.java:60)at com.adobe.idp.dsc.interceptor.impl.InvocationStrategyInterceptor.intercept(
InvocationStrategyInterceptor.java:55)at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(
RequestInterceptorChainImpl.java:60)at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(
InvalidStateInterceptor.java:37)at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(
RequestInterceptorChainImpl.java:60)at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(
AuthorizationInterceptor.java:188)at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(
RequestInterceptorChainImpl.java:60)at com.adobe.idp.dsc.interceptor.impl.JMXInterceptor.intercept(
JMXInterceptor.java:48)at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(
RequestInterceptorChainImpl.java:60)at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(
ServiceEngineImpl.java:121)at com.adobe.idp.dsc.routing.Router.routeRequest(
Router.java:129)at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.invoke(
AbstractMessageReceiver.java:329)at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapSdkEndpoint.invokeCall(
SoapSdkEndpoint.java:139)at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapSdkEndpoint.invoke(
SoapSdkEndpoint.java:81)at sun.reflect.GeneratedMethodAccessor791.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(
Method.java:597)at org.apache.axis.providers.java.RPCProvider.invokeMethod(
RPCProvider.java:397)at org.apache.axis.providers.java.RPCProvider.processMessage(
RPCProvider.java:186)at org.apache.axis.providers.java.JavaProvider.invoke(
JavaProvider.java:323)at org.apache.axis.strategies.InvocationStrategy.visit(
InvocationStrategy.java:32)at org.apache.axis.SimpleChain.doVisiting(
SimpleChain.java:118)at org.apache.axis.SimpleChain.invoke(
SimpleChain.java:83)at org.apache.axis.handlers.soap.SOAPService.invoke(
SOAPService.java:454)at org.apache.axis.server.AxisServer.invoke(
AxisServer.java:281)at org.apache.axis.transport.http.AxisServlet.doPost(
AxisServlet.java:699)at javax.servlet.http.HttpServlet.service(
HttpServlet.java:710)at org.apache.axis.transport.http.AxisServletBase.service(
AxisServletBase.java:327)at javax.servlet.http.HttpServlet.service(
HttpServlet.java:803)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:290)at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:206)at com.adobe.idp.dsc.provider.impl.soap.axis.InvocationFilter.doFilter(
InvocationFilter.java:43)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:235) -
I am not able to launch the Kerberos Configuration Manager due to the above error.
Any thoughts?
Thank you.
Credit CopHi,
Are you trying to connect to the remote machine?
There are a few limitations of Kerberos Configuration Manager tool.
The tool will only work in a single domain scenario. So, if you have the service installed in Domain A, but want to use a Service Account from Domain B, we won’t be able to discover and correct the issue appropriately.
Here is thread with the same error message:
http://social.msdn.microsoft.com/Forums/en-US/cd68c751-abe2-433a-a1ea-1951be24f46b/kerberos-configuration-manager-for-sql-server-access-of-system-information-failed?forum=sqltools
Reference:
http://blogs.msdn.com/b/psssql/archive/2013/11/22/kerberos-configuration-manager-updated-for-reporting-services.aspx
Thanks.
Tracy Cai
TechNet Community Support -
Transient attribute for a view object coming from a socket
Hello,
I'd like to create a readonly table (based on a view object without a backing entity).
Some columns are coming from a table and some other columns (based on the table key) are coming from a socket.
The problems is that the additional columns are all returned at once by the socket (to avoid calling it for every field and killing our network) and then stored in a java bean.
So i'd like to make the call to the socket once for every row of the table.
Do you know in which method of the View object should i make the call (maybe I should do this at the Row level ?)
Do you have any idea ?
thank you
-regards.Hi,
you can try the follwing
In the bindings of your jspx page you can see iterators defined under "executables". set the "*CacheResults*" property of the specific view object iterator that contains the transient attribute to false.(The default value is true).
Example:
<iterator Binds="EditWorkflowNodesView1" RangeSize="25"
DataControl="AdministratorAppModuleDataControl"
id="EditWorkflowNodesView1Iterator" CacheResults="false"/>
Regards,
Priya. -
ADF - Accessing view object from a button in a window
Hi
I am using Jdeveloper 10.1.3.2.0 to build a Swing/ADF application.
I added a method to a view class to call a database procedure.
I use that view as a base of a jTable to display data in a window.
Now I need to call the method that I created in the view class from a button on the same window where I display the data, ideally using the same db connection.
I am quite new to ADF and I have no idea how to get a reference to the view instance in the button method to call my new method. How can I do that? Is there another way to achieve this?
Thanks!
LuisYou usually do this by creating the method at the application module level and then exposing it as a client method. You can then drag and drop it onto your form as a button.
See details in the ADF Developer Guide chapters 8.3-8.5:
http://download.oracle.com/docs/html/B25947_01/bcservices003.htm#sm0206 -
Can't access non ejb classes from JSP - NoClassDefFound error
Hi,
I have one session ejb which has a method returning a collection of non ejb class objects (say of Class 'Foo').
The method signature is like :
"Collection getFinacialData() throws RemoteException"
It is working fine with normal java clients. Now when I run this from a JSP it gives a "NoClassDefFoundError". I kept class 'Foo' and the remote interface of the session bean in the same package and also in the same ejb jar file. Also I am running JSP and ejb in same WL server(ver 5.1, SP8 on solaris). What I have done is only deployed the bean jar file. Do I need to do anything more?
thanks in advance.
I ran into a similar problem. I solved it by putting the client classes for
accessing my EJB in the WebLogic POST_CLASSPATH in the startWebLogic script
file:
set POST_CLASSPATH=d:\weblogic\myserver\myClient.jar
For more information on class visibility between the JSP and EJB class
loaders, check out
http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_deployover.html#1056256
Rick
"niroja" <[email protected]> wrote in message
news:3a6ed903$[email protected]..
>
> Hi,
>
> I have one session ejb which has a method returning a collection of non
ejb class objects (say of Class 'Foo').
> The method signature is like :
> "Collection getFinacialData() throws RemoteException"
> It is working fine with normal java clients. Now when I run this from a
JSP it gives a "NoClassDefFoundError". I kept class 'Foo' and the remote
interface of the session bean in the same package and also in the same ejb
jar file. Also I am running JSP and ejb in same WL server(ver 5.1, SP8 on
solaris). What I have done is only deployed the bean jar file. Do I need to
do anything more?
>
> thanks in advance.
>
-
How can i restrict user to access database object (procedure) or JSP
Hi
I have 9ias infrastructure 902, on win2k box with 9i DB.
and I have one PL/SQL web application and another J2EE application both are hosted by 9ias 902.
Now we are looking forward to couple both with SSO.
I have deloyed samples of both and works fine.
Each application have different set of users, i mean there is no common user.
How can i restrict user not to view the web page which is not authorised to them.
as far as i understand from the Grocery demo is pick the role (which is a string only) from OID and programaticall apply security via if else endif construct.
can any one through light upto my concern.
regards
[email protected]Hey Mary
No i haven't try to do that via pl/sql....
as the our application is j2ee app... deployed in oc4j.. with sso and ldap....
still finding to do so....
what i have realized that LDAP is just to store user information in inverted tree... and one have to build separated access security mechnisum that will be applicable to j2ee system....
thanx...
samir.... -
Accessing Views via ODBC from MSAccess
Hello,
This started as a simple thing, allow somebody to access to a database on a SQL 2005 server so they could get to it from MSAccess. I have created a login (Windows Authentication) so they can see the database and gave them "public" and "datareader" abilities.
The user then informed me that while they could see the views they could not see the data. Not being a DBA (sorry) I added "public" to the view's permissions (under properties) and granted it "Select" access and nothing else. After I completed this the user could not even see the views to pick them (via the ODBC link from MSAccess) and when I try to remove "public" from the permissions it dissapears, but when I reopen the permission "public" is back.
I then find out there is no data in the views and so the user would not have been able view anything anyway.
So what I want to do is remove "public" from the views permissions, is this possible?
Thanks for any help,
TyroneIs anybody still curious about this?
Thanks!
Ed Price, Power BI & SQL Server Customer Program Manager (Blog,
Small Basic,
Wiki Ninjas,
Wiki)
Answer an interesting question?
Create a wiki article about it! -
Access to Class information from a static method
There does not appear to be anyway to access the Class object from instead a static method.
e.g. How could I convert the following code so that it works ?
class test {
static void printClassName() {
System.out.println( getClass().getName() );The idea was to have a static method that could be
used to make a lookup based on the classname. Being
able to access the class name would mean that I would
not have to reimplement for every subclass !!!!!Hmm.. what are you trying to look up? Some kind of class-specific constant information maybe?
In general your best bet is to define an abstract method in your parent class for return of the constant value, then define a specific method in each sub-class that overrides it, retrurning the appropriate value.
Then you're common processing just gets the value with that method.
Using some kind of lookup on the basis of class name is much clumsier, and more inclined to run time errors. Better to use the built in virtual methods table.
Another approach is to have the value as a parameter of the constructor of the parent class and use "super(value)" in the child classes to store
it. -
How can I pass information from jsp script to javascript
Hi, there,
in my project, after the user login successfully, I want to pop up a window using javascript to show some information retrieving from the database, for example, what's the user's firstname, lastname, visittimes, etc. these information is just visible in jsp script, so I don't know if there is a way to pass these information to javascript, for example, alert window to show these information to the user.
any hint will be great appreciated!!
thank you very much for your great help!!One possibility would be to use a Login PEI to set a unique UserInfo Name/Value for the user. I think in 5.0 each guest session is unique, so would have unique UserInfo. Then you could pass this value to your portlet (by specifying it in the web service) and use it as a key into a Application-scoped hashmap where you store your info. In other words, your Application variables option, but you have a way of uniquely naming your variables via PEI-set UserInfo.
Maybe you are looking for
-
I have a doubt in the thread mechanism..... Below is a sample of the class public class SimpleThread extends Thread { private int countDown = 5; private static int threadCount = 0; public SimpleThread() { super("" + ++threadCount); // Store the threa
-
Hi When i am running the Oracle stats pack report in Oracle ,I am getting the following error.Please find the error below.The OS version i am running is Solaris 9 and the Oracle version is 10.2.3.Request you to help me in understanding the root cause
-
Activate Airport on Disconnecting from Ethernet
Hey, I have a computer I use as a server, so I have it by default plugged into the Ethernet, with Airport Off (so that it uses the ethernet network). But I need to remote into it from off the network, and if it gets accidently unplugged, airport will
-
Dbms_java.grant_permission in Microsoft Windows
Hi, I have tried so many many times to get this working but have failed. When I ran the following statement, it did return 10 rows (10 files in the path in operating system). However, all rows showed null values with no data at all. I think this is s
-
The keyboard and trackpad to my 2008 MacBook suddenly stopped working. I've restarted the computer several times and no help. I had some keyboard maintenance done a few months ago at a repair shop so I don't know if that has anything to do with it. W