How to set the output in a Portlet?
Hi,
I'm creating a JSR-168 JSF Portlet application using Java Sun Studio Creator 2 Update 1. In my simple portlet, I want to be able to click a button and then see a page with a static text saying 'Button Clicked'. In my application:
1) I create a JSP page with one button
2) I modify that button's action method
3) In the action method, I can access the ActionRequest and ActionResponse
I want to be able to access the RenderRequest and RenderResponse so that I can modify the Portlet's output stream and thus modify the resulting page.
1) In the portlet created by Java Sun Studio Creator, how can I access the RenderRequest and RenderResponse?
2) More generally, how can I modify the output of a portlet page if I use the Java Sun Studio Creator portlet project? Is there a tutorial I can follow?
Thanks,
Marc
Hi,
I'm creating a JSR-168 JSF Portlet application using Java Sun Studio Creator 2 Update 1. In my simple portlet, I want to be able to click a button and then see a page with a static text saying 'Button Clicked'. In my application:
1) I create a JSP page with one button
2) I modify that button's action method
3) In the action method, I can access the ActionRequest and ActionResponse
I want to be able to access the RenderRequest and RenderResponse so that I can modify the Portlet's output stream and thus modify the resulting page.
1) In the portlet created by Java Sun Studio Creator, how can I access the RenderRequest and RenderResponse?
2) More generally, how can I modify the output of a portlet page if I use the Java Sun Studio Creator portlet project? Is there a tutorial I can follow?
Thanks,
Marc
Similar Messages
-
Sun ONE Studio 4 aka Forte: How to set the output path for classes ?
Help !
Beginner's question:
Sun ONE Studio 4 aka Forte:
How to set the output path for classes ?
As default, the class files are created in the same directory as the
sources.
In opposite, both JBuilder and Together support that there is a tree
with the sources and another tree with the classes.
The first answer I got was "not possible with Forte, but just if you write your own "ANT Build script" !
a) Please point me to a ready-to-use ANT script for this purpose, if such is available
b) Is using ANT instead of the MAKE as comfortable ? Besides the separation of sourcecode and classes, I would like to keep everything else to be the same, i.e. I don�t want to edit the ANT file if I enlarge the project by directories or files.
Tia
Sincerely
RolfYou can set S1S's options to place newly created .class files in a specific location.
Identify the compiler that is being used - Open the S1S's Tools/Options window, expand Editing and select Java Sources. Note the Default Compiler value. (If it's one if the Ant options, you use Ant to specify this option, not S1S.)
Open the S1S's Tools/Options window, expand Building/Compiler Types and select the appropriate compiler.
The Properties tab of the compiler has the property Target, which sets the filesystem where the compiler output is directed. If you choose <not set>, the .class files are written to their source directory.
When you set the Target, your change affects all classes that use this compiler.
Very few options can't be set in S1S; the challenge is finding out where they're set! -
How to set the output list in alv
hai all,
i have copied the standard alv program into customized and the out put of customized have changed . but the output listy of this customized program is to be changed like standard program . please tell me how to do this i have setting the current layout of it . it will display only for time been whemni come out of that program it will change .Hi,
After changing the layout to desired output. Save the layout and set it as default. Then it will work for every time.
Thanks
Chandra -
ADF - Component File Download Listener - Setting the output filename
Studio Edition Version 11.1.1.2.0
Hi, I would like to learn how to set the output filename as current data + filename. I have a button with the component File Download Listener that has theses parameters
Content/Type: application/pdf
Filename: test.pdf
Method: fullReportPDF()
I needed that when the user clicks the button, that he return the current date + filename statically defined.
How i may to make this?In a bean you implement a method which return the filen ame date and static part concatenated and set it as EL into the af:fileDownloadActionListener
// on the page
<af:fileDownloadActionListener contentType="application/pdf"
filename="#{XYZBean.filename}"
method="#{XYZBean.fullReportPDF}"/>
// in the bean
public String getFilename()
String fn = (new Date()).toString() + "static_part.xyz";
return fn;
public void fullReportPDF(FacesContext facesContext, OutputStream outputStream) { ... }where XYZBean is the bean where you have implmented the method fullReportPDF.
Timo -
How to set the view privilege of a portlet?
Dear all,
I would like to ask how to set the view privilege of a portlet (which is located on the Intranet homepage) to only a group of users?
As far as I know, I can create a tab with view privilege to address the about scenario. But is it possible to directly set the view privilege to the portlet ?
thanks
George (HK)
Welcome to my photo albums at http://community.webshots.com/user/GeorgeLee80
Message was edited by:
georgelkhOK, you got me there George. I don't know where you can set view rights to an out of box portlet. So how about a different approach?
1) Create a blank page with no nav bar or anything else
2) Assign the group you want to see the notifications portlet view rights on the page
3) Make sure the show as portlet check box is checked on the Optional tab in the page properties
4) Add the notifications portlet to the page
5) Ensure the portlet settings are how you desire in terms of what notifications to show and the region settings are how they should be in terms of border, headers, etc
6) Edit the page where you want the notifications portlet to be shown and add the page portlet you just created instead of the notification portlet
This should achieve what you seek without having to dig into out-of-box portlets.
Rgds/Mark M. -
How to set the table input in Query template?
Hi all.
I need to call a Bapi_objcl_change, with import parameter and a table as an input. I have done this, in BLS. I have set the table input in the
form of xml. In BLS, I get the output(the value gets change in SAP R3, what i have given in BLS). But if i set the same xml structure in
query template, I didn't get the output. Table input parameter does not take that xml source. How to set the table input in Query template?
can anyone help me?
Regards,
HemalathaHema,
You probably need to XML encode the data so that it will pass properly and then xmldecode() it to set the BAPI input value.
Sam -
How to use the Output clause for the updated statment
How to use the output clause for the below update stament,
DECLARE @MyTableVar table(
sname int NOT NULL)
update A set stat ='USED'
from (select top 1 * from #A
where stat='AVAILABLE' order by sno)A
Output inserted.sname
INTO @MyTableVar;
SELECT sname
FROM @MyTableVar;
Here am getting one error incorrect syntax near Output
i want to return the updated value from output clausesee
http://blogs.msdn.com/b/sqltips/archive/2005/06/13/output-clause.aspx
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
hi i am creating xml publisher and from OAF with parameters
cusname:
runreportdate:
go clear buttons
click go open report in pdf
SELECT hp.party_name CustomerName,
csi.incident_number SRNumber,
to_char(csi.incident_date,'DD-MON-YYYY') SRDate,
to_char(csi.close_date,'DD-MON-YYYY') SRCloseDate,
mtl.description SRItemName,
csi.summary Summary,
csi.problem_code,
csi.incident_address SRAddress,
csi.INCIDENT_COUNTRY SRCountry,
'31-DEC-2008' Reportrundate,
COUNT ( * ) over () cnt,
cis.name,
COUNT(
CASE
WHEN cis.name='Low'
THEN 1
END) over () Low,
COUNT(
CASE
WHEN cis.name='Medium'
THEN 1
END) over () Medium,
COUNT(
CASE
WHEN cis.name='High'
THEN 1
END) over () High1,
to_char(csi.incident_date,'MON-YYYY') SrMonth
FROM hz_parties hp,
hz_cust_accounts hca,
hz_contact_points hc,
cs_incidents_all_b csi,
ar_lookups arl,
cs_incident_severities_b cis,
mtl_system_items_kfv mtl
WHERE hca.cust_account_id =csi.account_id
AND hp.party_type IN ('PERSON','ORGANIZATION')
AND hp.status ='A'
AND hp.party_id = hca.party_id
AND hca.status ='A'
AND hp.party_id =hc.owner_table_id(+)
AND hc.owner_table_name(+) ='HZ_PARTIES'
AND hp.party_id =hca.cust_account_id
AND hc.contact_point_type(+)='PHONE'
AND hc.primary_flag(+) ='Y'
AND hc.status(+) ='A'
AND arl.lookup_type(+) = 'PHONE_LINE_TYPE'
AND arl.lookup_code(+) = hc.phone_line_type
AND hp.party_name='Business World'
AND csi.incident_date BETWEEN to_date('01-JAN-2000','DD-MON-YYYY') AND to_date('31-DEC-2008','DD-MON-YYYY')
AND cis.incident_severity_id=csi.incident_severity_id
AND mtl.inventory_item_id=csi.inventory_item_id
GROUP BY hp.party_name,
csi.incident_number,
csi.incident_date,
csi.close_date,
csi.summary,
csi.problem_code,
csi.incident_address,
cis.name,
csi.INCIDENT_COUNTRY,
mtl.description,
to_char(csi.incident_date,'MON-YYYY')
Am code
public void initQuery(String paramString1, String paramString2)
SrReportVOImpl vo=getSrReportVO1();
if ((paramString1 != null) && (!("".equals(paramString1.trim()))) && (paramString2 != null) && (!("".equals(paramString2.trim()))))
vo.setWhereClauseParams(null);
vo.setWhereClauseParam(0, paramString1);
vo.setWhereClauseParam(1, paramString2);
vo.executeQuery();
public XMLNode getPrintDataXML()
//SrReportVOImpl vo=getSrReportVO1();
OAViewObject vo = (OAViewObject)findViewObject("SrReportVO1");
//vo.initQuery(s,s1);
XMLNode xmlNode=(XMLNode) vo.writeXML(4,XMLInterface.XML_OPT_ALL_ROWS);
return xmlNode;
CO code
SrAMImpl am=(SrAMImpl)pageContext.getApplicationModule(webBean);
if(pageContext.getParameter("Go")!=null)
//am.searchSrDetails(pageContext,webBean);
String s=pageContext.getParameter("CustomerName");
String s1=pageContext.getParameter("RunReportDate");
am.initQuery(s,s1);
// Get the HttpServletResponse object from the PageContext. The report output is written to HttpServletResponse.
DataObject sessionDictionary = (DataObject)pageContext.getNamedDataObject("_SessionParameters");
HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,"HttpServletResponse");
try {
ServletOutputStream os = response.getOutputStream();
// Set the Output Report File Name and Content Type
String contentDisposition ="attachment;filename=ServiceReport.pdf";
response.setHeader("Content-Disposition",contentDisposition);
response.setContentType("application/pdf");
Serializable param[]={pageContext.getParameter("CustomerName"),pageContext.getParameter("RunReportDate")};
System.out.println("hiiii 12");
// Get the Data XML Output as the XMLNode
XMLNode xmlNode = (XMLNode) am.invokeMethod("getPrintDataXML",param);
System.out.println("hiiii 13");
System.out.println(xmlNode.toString());
System.out.println("hiiii 14");
// Get the Data XML File as the XMLNode
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
xmlNode.print(outputStream);
ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();
//Generate the PDF Report.
TemplateHelper.processTemplate(
((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
APP_NAME,
TEMPLATE_CODE,
((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
inputStream,
TemplateHelper.OUTPUT_TYPE_PDF,
null,
pdfFile);
// Write the PDF Report to the HttpServletResponse object and flush.
byte[] b = pdfFile.toByteArray();
response.setContentLength(b.length);
os.write(b, 0, b.length);
os.flush();
os.close();
pdfFile.flush();
pdfFile.close();
catch(Exception e)
response.setContentType("text/html");
throw new OAException(e.getMessage(), OAException.ERROR);
pageContext.setDocumentRendered(false);
System.out.println("hiiii 13");
if(pageContext.getParameter("Clear")!=null)
am.ClearFields(pageContext,webBean);
}can any one tell me how to set the bind parameters or setting parameterHi,
Could not understand your problem exactly. DId you try adding bind variables in the query like below:
AND hp.party_name='Business World'
AND csi.incident_date BETWEEN to_date('01-JAN-2000','DD-MON-YYYY') AND to_date('31-DEC-2008','DD-MON-YYYY')
change to
AND hp.party_name=:1
AND csi.incident_date BETWEEN :2 AND :3
Please note you will need three bind variables. Second and third for SR Dates.
~Amol -
LabWindows / CVI: how to change the output executable file name
For example, I have an A project a.prj, I do not want to compile the output file is a.exe, but b.exe.
I will try to save as a.prj b.prj, a.cws save as b.cws
eg:a.prj ---->(output)--->b.exe
Solved!
Go to Solution.You can go to Build >> Target Settings menu item, select Release (or Release 64) in the Configuration filed and set the name of the executable to create in Application FIle field, withouyt need to change the prj or cws filename.
See the complete description of available options here.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
How to set the size of SUM()/SUM() of NUMBER Tyep?
I met the oracle truncation error when I post the
SUM(a field)/SUM(b field), a and b field are NUMBER Type
From the OCI Doc, Numbers with up to 38 digits precision.
and I set the size of data buffer 41 for NUMBER TYPE.
(for example)
rc = OCIDefineByPos( hstmt, &m_pDefine, ((CEBOracle *)pDatabase)->m_hpErr, index,
(dvoid *) m_lpszBindData, m_nBufSize+1, SQLT_STR,
(dvoid *) m_cbIndicator, (ub2 *) 0, (ub2 *) 0, OCI_DEFAULT);
I always set the output datatype as SQLT_STR
and m_nBufSize is 41 for NUMBER Type
my client met the error when the result is 0.00012345678912345678912345678912345678912
I think that it's not a solution that just enlarge the number form 41 -> 45
How can I avoid this problem when user send the SQL Statement that the result has unlimited decimal number?
Thank you in advancdORA-01406 fetched column value was truncated
I found the reason of that problem.
I migrated from OCI Ver7 to Ver8
If I set the buffer size to 10 (actually 40 in my program) and the result was
0.0000000000000000001
When I debuged the output buffer
The result was 1.0E-19
but now 0.00000000 and truncation error
how to change floating point and scientific expression automatically depend on the result like OCI Ver7 and SQL PLUS?
I changed define function
odefin(m_hstmt, ii+1, (UCHAR *) m_lpszData[ii], m_lpLength[ii]+1, SQLT_STR, -1, m_lpcbValue[ii], 0, -1, -1, 0, 0);
to
m_rc = OCIDefineByPos( m_hstmt, &pDef, ((CEBOracle*) m_pDatabase)->m_hpErr, ii+1,
(dvoid *) m_lpszData[ii], m_lpLength[ii]+1, SQLT_STR,
(dvoid *) m_lpcbValue[ii], (ub2 *) 0, (ub2 *) 0, OCI_DEFAULT ); -
How to set the heap size of JVM
please let me know that how to set the heap size of JVM
C:\>java -X
-Xmixed mixed mode execution (default)
-Xint interpreted mode execution only
-Xbootclasspath:<directories and zip/jar files separated by ;>
set search path for bootstrap classes and resources
-Xbootclasspath/a:<directories and zip/jar files separated by ;>
append to end of bootstrap class path
-Xbootclasspath/p:<directories and zip/jar files separated by ;>
prepend in front of bootstrap class path
-Xnoclassgc disable class garbage collection
-Xincgc enable incremental garbage collection
-Xbatch disable background compilation
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size
-Xprof output cpu profiling data
-Xrunhprof[:help]|[:<option>=<value>, ...]
perform JVMPI heap, cpu, or monitor profiling
-Xdebug enable remote debugging
-Xfuture enable strictest checks, anticipating future default
-Xrs reduce use of OS signals by Java/VM (see documentation)look at the -Xm? lines
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap sizeThis can be used e.g. like this:java -Xms8M -Xmx32M MyProgwhich runs MyProg in a java VM with the initial heap size of 8 MB and a maximum heap size of 32 MB.
- Marcus -
HOW TO SET THE OUR OWN LINE SPACING ?
hai frenz...
i jus wanted to know how to set the our own spacing between the records or lines...
i.e.,
there shub be no spacing between the records when its getting displayed...
for e,g.,
actually my records are in the output screen displaying like this.....
hyundai 100 200
maruthi 100 300
tata 200 200
but i want to be displayed like this...
hyundai 100 200
maruthi 100 300
tata 200 200
how to do that........ reply me....Hi,
Use SKIP Abap Statement
SKIP 2.
SKIP TO LINE 1.
SET BLANK LINES {ON|OFF}.
Example
REPORT demo_skip NO STANDARD PAGE HEADING.
DATA sum TYPE i.
TOP-OF-PAGE.
SKIP.
ULINE.
START-OF-SELECTION.
DO 10 TIMES.
WRITE / sy-index.
sum = sum + sy-index.
ENDDO.
SKIP TO LINE 1.
WRITE: 'Numbers with sum' COLOR COL_HEADING,
sum COLOR COL_TOTAL. -
How to set the default selection screen
I modified screen using screen-input = 0.
then how to set the screen-input = 1.
that is how to make that field input enable.
if use the statement screen-input = 1 directly it is giving 2 fields to enter valueIn the PBO / AT SELECTION-SCREEN OUPUT
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = <your FIELD>. " Fields by name
* IF SCREEN-GROUP1 = <your group of fields>. " Fields with MODIF ID
IF <test>.
screen-input = 1. " For input enable
ELSE.
screen-input = 0. " For input disable
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Regards -
How to set the BARCODE width and length for label printing..
Hi All,
How to set the Code 39 barcode label format in the sizxe of 0.20" * 1.4". By default while printing barcode size exceeds my current requirement. Please let me know to customize the size of barcode labels.
Thanks.I don't know what you mean by "Code 39" because my Output Designer software doesn't offer that barcode (or do you mean "code 3 of 9?). In any case, are you trying to control the size of the text (which is what I think of when you refer to "label")? If you are, then just change the font & size. If you are wanting to modify the physical characteristics of the barcode itself (height & length for a certain number of characters) then you are probably out of luck. Or at least in for some trial & error.
There are a series of "barcode.xxx" files in the 'config' folder where Output Designer was installed to. These are text files that contain the physical characteristics of the various barcodes for various printers. The parameters that you would be interested in is the height and width of the bars (black & white). For example, a barcode might be defined as .400 high with narrow bars 3 "dots" wide, wide bars 9 "dots" wide and white space the same or different. Presumably changing these values would affect the generated barcode. For example, in this example the wide bars are 3 times the width of the narrow bars so I would assume that relationship would have to remain. To make the resulting barcode shorter you would then use 2 for the narrow and 6 for the wide.
You would have to make the change in the file(s) that would be used for your printer(s).
There are four width values for each of the parameters. Most of the barcodes only use 2 but some have 4. I'm assuming that when there are 4, like in "4 8 12 16", that the barcode definition has 4 different widths of bars and/or spaces.
There is no guarantee that the scanning hardware & software will "see" and interpret the resulting barcode correctly. -
How to set the sampling interval using DAQ device?
Now I have a capacity sensor and a 24 bit DAQ device (http://www.mccdaq.com/usb-data-acquisition/USB-2404-10.aspx).
The DAQ device has the maximum sampling rate of 50kS/s . My question is how to set the interval of data collection. For example, if I set the sampling rate to 2000, in continuous sampling mode, I use DAQmx read.vi in a while loop and set the 'number of samples per channel' to 100. I want to plot these data as a function of time by using a XY graph and also save these data. So I add a 'Mean' function to get the average of the 100 samples per each loop (than means, there are 20 data output per second). But when I set the 'number of samples per channel' much smaller (to get more data per second), there are some problems. It seems that the program cannot read so many data and get the average at a higher frequency. I don't know where the problem is. All in all, how to collect data more frequently?Maybe I didn't express my question clearly. I'll upload a simple program later if necessary. Thanks.
Solved!
Go to Solution.Another question is in continuous mode, NI DAQmx uses Samples per channel to determine the buffer size. But according to the website you specified, it says if the acquisition is continuous (sample mode on the DAQmx Timing.vi is set to Continuous Samples), NI-DAQmx will allocate a buffer according to the following table. And for sample rate between 100 - 10,000 S/s, the buffer size is 10 kS. So if I set the sample rate to be 5000 S/s, and set the Samples per channel to be 20000, then what exactly the buffer size is? 20 kS or 10 kS?
Thanks.
Maybe you are looking for
-
In Preview I can drag several individual PDF pages into it to create a multiple page document. However, when I try to save, export or print this combined document, all I get is the first page. When I close the document, I lose all of the work I spent
-
How do i access my photos sent to the cloud?
My friend sent a good portion of my photos to the cloud to give me enough storage to download ios8. I can't figure out how to access the photos that were sent to the cloud.
-
Recovered deleted iPhoto library is in wrong format?
My iPhoto library was deleted so I used Disk Drill Pro and seemingly successfully recovered them. I recovered them and saved them to a USB drive but when I click the recovered library, iPhoto says it doesn't recognize the format. This is what the con
-
Cannot get mail, The connection to the server failed.
I have started receiving this message when opening the mail app on my iphone 5S (latest IOS 7.0.6) to specifically view my outlook.com mail. I tried deleting the account and re-adding it but the problem persists. Restarted the phone, tried everything
-
Shall we add any NOTE(search tips) in OVS
Dear Experts, We have used OVS component for one input field. after clicking on F4 we are having a window (set_configuration).in that we require some note(search tips note) to be displayed. kindly help in this regard. Regards