Hi,
I would like to replace my existing presentation layer only, which is developed in JSP/Servlets to SmartClient.
The existing application ,I am uses <form method=post action=ReportsContrllerServlet> for every action of JSP controls(hyperlink, button).
But If I use SmartClient then Form controls and List control values are not coming to Servlet class, because it uses its own way(RPCManager and DMI) of retrieving values inside Java class.
Would you please reply, if I replace SmartClient as presentation layer should I modify the other layer as well as to get the form values?.
In our existing application, used one of the column as hyperlink, selecting it calls Servlet and process and navigates from there.
Is it possible to have hyperlink inside Grid control with action same as JSP code having?
Requesting you to clarify above doubts without re-directing to somewhere.
Generally you want to connect SmartClient to your data & services tier via DataSources. RPC DMI in one way of doing this; the QuickStart Guide chapter on Data Integration covers all of the available approaches.
A DynamicForm can be made to behave identically to a native HTML form by setting canSubmit:true and calling submit() (as opposed to calling saveData() to save via a DataSource). This is sometimes appropriate for incrementally upgrading a legacy application.
Similarly, you can create grid cells that contain hyperlink that will go any given URL by using listGridField.formatCellValue() to return the HTML for a link (<a href=“…”). This likewise can be appropriate for incrementally upgrading legacy applications.
(also: if you prefer not to read our free, professionally prepared documentation, paid training is available)
Not able to refer JSP variable inside SmartClient tag
Hi,
I thank you for your earlier replies.
I am trying to replace only presentation layer with SmartClient tool.
Here one of the column is anchor tag in my existing app. Since I am mapping POJO’s to ListGrit, I cannot use formatCell syntax in List Grid as you mentioned.
Please find below code I am getting the results by using below ListGrid format.
Here in my existing code, the query strings are passed to some utility method for constructing value,
Issue here is, I cannot refer any JSP varaibale or method inside the tag?
Would you please have a look below code,one of the Query String I am having like Util.validateInput(…)?
Could you please clarify how I can refer java variable or method(Which was exists conventional coing)?
It’s not clear what validateInput is supposed to be doing, but SmartClient has no impact on how .jsps are interpreted. If you’re not sure, try the same code elsewhere and it will fail in the same way.
We still recommend doing this via formatCellValue() if what you are trying to do is format data.
SmartClient doesn’t affect how those JSP tags render. Your not providing an error message or a description of what’s not working as you expect, so it’s not really possible to comment further..
Please see the line below in JSP has decklared one string variable.
<%
String checkStr=“getSummaeyContentbyID”;
%>
After that I am populating session variable in ListGrid by below.
here ‘sessionData’ is set in Servlet like
session.setAttribute(“sessionData”,“accountData”); Anything which is in session scope it works.
But if I refer checkStr which is declared above not able to use inside the tag below, it is returning empty value.
Hi,
if you still not able to get my clarification, I put it simple way
Assume that I declared one varaible in JSP as below
<%
String checkStr=“Testing JSP value”;
%>
Below I am using ListGrid(Mapping POJO format for displaying values in JSP)
using session variable which is set in servlet.
My clarification is,
The ${checkStr} which is declared in JSP in the ListGrid NOT working returning empty values.
So again, SmartClient does not affect how your .jsp executes…
Try the same expression elsewhere (outside of the SmartClient component definition) to verify this.
Also, it’s not clear how you’re actually checking whether something was output. The correct way would be to look at the generated JavaScript code and see if the expected value is there.
OK, here’s how to convince yourself that this has nothing to do with SmartClient. Remove everything in your example that has anything to do with SmartClient, leaving a completely plain JSP/JSTL example - it now looks like this, right?
<!-- include core JSTL taglibs -->
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<!-- make sure EL is enabled for this page -->
<%@ page isELIgnored="false" %>
<%@ page import="java.util.*" %>
<%@ page import="com.jpmorgan.corea.cow.bean.*" %>
<%
String baseURL = "http://localhost:8080/test";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<body>
<c:forEach var="test" items="${TestAccounts}">
<c:out value="${test.accountID}"/>
<c:out value="<a href=${baseURL}/TestControllerServlet?command=${test.accountName}>${test.accountName}</a>"/>
</c:forEach>
</body>
</html>
Run this JSP. Note how it still isn’t displaying the value of “baseURL”. SmartClient does not affect how your JSP executes - honest!
Just wanted to check in that you’ve found your way past your JSP issue, also, make sure you review the capabilities of SmartClient DMI and the RPCManager, which will allow you to connect to the Java Beans you are currently trying to output via JSTL, in a simpler matter that will also enable data paging for large datasets, adaptive filtering and sorting, and many other sophisticated SmartClient features.
Hi,
Thanks for your reply.
I do understand there was no issues in SmrtClinet in the JSP.
I had been asked to change only presentation layer, If I use RPCManager and DMI then I have to modify other layer as well to get the values JSP to DAO pattern and vice versa which definitely not allowed.
Below is my Sample DataSource for earlier communicated JSP. In existing application , servlet will have the data in session to display it in presentation layer.
So I have to use ListGrid with the one I mentioned in JSP right for this scenarion right?
In this case, Would you please reply your feedback, How I can rectify this issue?(Getting java varibale inside tld and list grid)
Using RPC DMI does not mean changing something other than the “presentation layer”. You can use the same pattern of arranging for some set of beans to be in the session and accessing that data from the “view”. In this case the view is a Java method instead of some .jsp code, but it’s still the presentation layer.
If you are somehow restricted to writing .jsp files only, you can still use the RPCManager without using DMI - see the samples accessible from the SDK Start page in Examples -> Java Integration.
Using RPCManager involves changes req in other layer
Hi,
You are absolutlely right, it is JSP tab library change.
But please confirm if I use RPCManager/DMI as suggested by you then, Will it be changig requires in back-end layer as well correct?
For exaple, I need to process the data from fron-end to back-end code by
RPCManager rpc = new RPCManager(request, response, out);
Object data = rpc.getData();
System.out.println("client sent: " + data.toString());
rpc.send(“here’s a response”);
If you what you mean by “changing the back-end layer” is writing any Java code whatsoever, even if in a JSP, then yes, you do need to write Java code to use the RPCManager.
From an architectural standpoint, this is normally not considered to be “changing the back-end layer”. Architectural layers are conceptual and should not be defined in terms of what kind of code is being written.
However if you have bizarre coding standards that you are dealing with that prevent you from using the RPCManager, your best option is to use the RestDataSource on the client side and output XML responses using JSP tags as you started with. But using the RPCManager as designed is going to be much simpler and produce a much better result.