shree lk

Greenhorn
+ Follow
since Mar 16, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by shree lk

Hi All,

I want to include errorPage in .xtml, as done in jsp i.e inclusion of error page using "iserrorPage" and "errorPage". How it can be done in xhtml page.

Thanks in advance.

13 years ago
JSP
Hi All,

I want to include errorPage in .xtml, as done in jsp i.e inclusion of error page using "iserrorPage" and "errorPage". How it can be done in xhtml page.

Thanks in advance.


How to include errorpage in xhtml page.
Hi All,

I want to include errorPage in .xtml, as done in jsp i.e inclusion of error page using "iserrorPage" and "errorPage". How it can be done in xhtml page.

Thanks in advance.
13 years ago
JSF
Try this..

<ui:include src="/mypage.xhtml" />
13 years ago
JSF
Hi all.

I am getting java.lang.UnsupportedOperationException while storing the data into arraylist from database.

My code is....




public List displayNotice() throws SQLException, ClassNotFoundException
{

Class.forName("com.mysql.jdbc.Driver");
Connection con1=DriverManager.getConnection("jdbc:mysql://localhost:3306/mydatabase","root","root");

Statement st=con1.createStatement();
ResultSet rs=st.executeQuery("select noticedate, notice from mytable");
while(rs.next())
{
Notice note = new Notice();
note.setToday(rs.getString(1));
note.setEditor(rs.getString(2));



try
{
arrList.add(note);


}catch(Exception e)
{
e.printStackTrace();
}
return arrList;

}



It showing the above exception for add() fuction, due to which I am not able to get the data from database.

Help Please...
14 years ago
JSF
Hi all..

I am working with rich editor in JSF. Below rich editor I have 5 rows or panels to display contents that has been entered in editor. My requirement is that I need to display entered content one by one. It is just like this forum, Whenever I submit the topic it will list all the topics submitted one by one displaying newly submitted topic on top. I have used <rich: datatable>. But i am not getting it. I am not able to display old content submitted. It is replaced by newly entered..

Please Help..
I have stuck with this from 3 days...
14 years ago
JSF
Hi all
I am working with JSF. I have used RichFaces's 'RichEditor'. I am storing contents from this editor into a bean and displaying into a JSF form. But it shows HTML tags on the JSF form. For that I have used JSoup HTML Parser. But it completely converts the written content of the rich editor to simple text, removing all formatting like bold, buttons used, newline, etc. I need to display as it is in the jSF form as the editor.


Please Help
14 years ago
JSF
Hi all...

I have added <rich: calendar> using RichFaces. I also have 3 radio buttons for different holiday types like general, festival, public like that. I want assign these holiday to calendar dates and change color of the date to specific color.
Suppose I select date 24-Mar-2011 on Calender and Festival holiday with radio button it would change the color of date 24-mar-2011 to red. like that...

I am working with eclipse and tomcat7.

Please help
14 years ago
JSF
Hi all...

I have added 3 radio buttons on my JSF from. I want to store value of selected radio button into bean so that I can display it on the JSF from. Can anybody please suggest how to get it??


Also with calender, When i display the selected date on the JSF from it shows previous day, not the selected day. But when i display in console it shows the selected day without problem..




Following is code I used in the JSF.

<h:form id="calendarForm">

<style type="text/css">

.yearRowStyle {
background-color: #A8D1E8;
color: red;
text-align: center;
font-weight: bold;
font-style:italic;
}
.weekRowStyle {
background-color: #D6EBFC;
}
.selectedDayCellStyle {
background-color: #ECD5D2;
}

</style>

<h3> <h:outputText value="Select Date" style="color:blue"/> </h3>

<t:inputCalendar id="MyCalendar" monthYearRowClass="yearRowStyle"
weekRowClass="weekRowStyle"
currentDayCellClass="selectedDayCellStyle"
value="#{calendarBean.selectedDate}" />

<br><br>


<t:selectOneRadio id="SR" value="SI"
layout="spread"
border="1"
style="font-weight:bold" binding="#{calendarBean.radioSelect}" >

<f:selectItem id="sel1" itemLabel="Public Holiday" itemValue="ph" />
<f:selectItem id="sel2" itemLabel="General Holiday" itemValue="gh" />
<f:selectItem id="sel3" itemLabel="Festival Holiday" itemValue="fh" />

</t:selectOneRadio>

<h3> <h:outputText value="Select Holiday Type" style="color:blue"/> </h3>

<t:panelGrid columns="1" width="20%" style="color:red;"
cellpadding="0" cellspacing="5">

<t:panelGroup>
<t:radio for="SR" index="0"></t:radio>
</t:panelGroup>

<t:panelGroup>
<t:radio for="SR" index="1"></t:radio>
</t:panelGroup>

<t:panelGroup>
<t:radio for="SR" index="2"></t:radio>
</t:panelGroup>

</t:panelGrid>

<br><br>

<h:commandButton id="dateBtn" value="Submit" action="#{calendarBean.onDate}" />

</h:form>



AND my bean java file is..

package com.calendar.web;

import java.util.Date;

public class Calendar
{

Date selectedDate;
String radioSelect;


public Date getSelectedDate() {
return selectedDate;
}


public void setSelectedDate(Date selectedDate) {
this.selectedDate = selectedDate;
}


public String getRadioSelect() {
return radioSelect;
}


public void setRadioSelect(String radioSelect) {
this.radioSelect = radioSelect;
}




public String onDate()
{

String a=selectedDate.toString();

System.out.println(a);
System.out.println(radioSelect);



return "dateSelect";

}
}
14 years ago
JSF
check out database connection statements. I think you are missing some thing there...
Hello All...

I am trying with <t:inputCalendar>tag in JSF. Where to write the event handler code when we click on date which is shown on the browser. I have "onclick" attribute to write javascript code. but i am getting where to write this code. Whether in the tab itself or in separete .js file..


Please Help
14 years ago
JSF
Hello All...

I am trying with <t:inputCalendar>tag in JSF. Where to write the event handler code when we click on date which is shown on the browser. I have "onclick" attribute to write javascript code. but i am getting where to write this code. Whether in the tab itself or in separete .js file..


Please Help
14 years ago
JSF
Hello All...

I have problem with JSF file uploading.

I have uploaded excel file with ' inputFileUpload' tag of JSF and given value using BEANS as #{myBeans.myFile} to the tag. Now in backbean java file I can't able to get that file so that I can process or parse excel file. I declared it as follows
String inputFile= " #{myBeans.myFile}". But its not working. I don't know whether its right??. I also given getters & setters for 'inputFile' . But when i give direct path of the file like- String inputFile="c:/upload/test.xls" I am able to process that excel file file successfully. I have used POI to parse excel file.

Also I am able to display contents of xls from JSf form in the browser. Although I am getting it on the tomact console. I used following code to parse and display xls file contents.


Can anybody suggest solution to this. Also how to display xls file contents to browser with JSF form.

public String fileSubmit() throws IOException
{

inputFile= "c:/upload/test.xls";


//inputFile="#{attend.inputFile}";

List cellDataList = new ArrayList();



try
{
/*
* Create a new instance for FileInputStream class
*/
FileInputStream fileInputStream = new FileInputStream(inputFile);

/*
* Create a new instance for POIFSFileSystem class
*/

POIFSFileSystem fsFileSystem = new POIFSFileSystem(fileInputStream);

/*
* Create a new instance for HSSFWorkBook Class
*/

HSSFWorkbook workBook = new HSSFWorkbook(fsFileSystem);
HSSFSheet hssfSheet = workBook.getSheetAt(0);

/*
* Iterate the rows and cells of the spreadsheet to get all the data.
*/

Iterator rowIterator = hssfSheet.rowIterator();

while (rowIterator.hasNext())
{
HSSFRow hssfRow = (HSSFRow) rowIterator.next();
Iterator iterator = hssfRow.cellIterator();
List cellTempList = new ArrayList();

while (iterator.hasNext())
{
HSSFCell hssfCell = (HSSFCell) iterator.next();
cellTempList.add(hssfCell);
}
cellDataList.add(cellTempList);
}
}
catch (Exception e)
{
e.printStackTrace();
}


printToConsole(cellDataList);
// List retList=printToConsole(cellDataList);

return "upLoaded";
}

private List printToConsole(List cellDataList)
{
for (int i = 0; i < cellDataList.size(); i++)
{
List cellTempList = (List) cellDataList.get(i);
for (int j = 0; j < cellTempList.size(); j++)
{
HSSFCell hssfCell = (HSSFCell) cellTempList.get(j);

String stringCellValue = hssfCell.toString();
System.out.print(stringCellValue + "\t");




}
System.out.println();


}


return cellDataList;



}





Thanks...
14 years ago
JSF
Hello All...

I have problem with JSF file uploading.

I have uploaded excel file with ' inputFileUpload' tag of JSF and given value using BEANS as #{myBeans.myFile} to the tag. Now in backbean java file I can't able to get that file so that I can process or parse excel file. I declared it as follows
String inputFile= " #{myBeans.myFile}". But its not working. I don't know whether its right??. I also given getters & setters for 'inputFile' . But when i give direct path of the file like- String inputFile="c:/upload/test.xls" I am able to process that excel file file successfully. I have used POI to parse excel file.

Also I am able to display contents of xls from JSf form in the browser. Although I am getting it on the tomact console. I used following code to parse and display xls file contents.


Can anybody suggest solution to this. Also how to display xls file contents to browser with JSF form.

public String fileSubmit() throws IOException
{

inputFile= "c:/upload/test.xls";


//inputFile="#{attend.inputFile}";

List cellDataList = new ArrayList();



try
{
/*
* Create a new instance for FileInputStream class
*/
FileInputStream fileInputStream = new FileInputStream(inputFile);

/*
* Create a new instance for POIFSFileSystem class
*/

POIFSFileSystem fsFileSystem = new POIFSFileSystem(fileInputStream);

/*
* Create a new instance for HSSFWorkBook Class
*/

HSSFWorkbook workBook = new HSSFWorkbook(fsFileSystem);
HSSFSheet hssfSheet = workBook.getSheetAt(0);

/*
* Iterate the rows and cells of the spreadsheet to get all the data.
*/

Iterator rowIterator = hssfSheet.rowIterator();

while (rowIterator.hasNext())
{
HSSFRow hssfRow = (HSSFRow) rowIterator.next();
Iterator iterator = hssfRow.cellIterator();
List cellTempList = new ArrayList();

while (iterator.hasNext())
{
HSSFCell hssfCell = (HSSFCell) iterator.next();
cellTempList.add(hssfCell);
}
cellDataList.add(cellTempList);
}
}
catch (Exception e)
{
e.printStackTrace();
}


printToConsole(cellDataList);
// List retList=printToConsole(cellDataList);

return "upLoaded";
}

private List printToConsole(List cellDataList)
{
for (int i = 0; i < cellDataList.size(); i++)
{
List cellTempList = (List) cellDataList.get(i);
for (int j = 0; j < cellTempList.size(); j++)
{
HSSFCell hssfCell = (HSSFCell) cellTempList.get(j);

String stringCellValue = hssfCell.toString();
System.out.print(stringCellValue + "\t");




}
System.out.println();


}


return cellDataList;



}





Thanks...
14 years ago
JSF