Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


debasis
Java urgent
0 Answer(s)      4 years and 4 months ago
Posted in : Design concepts & design patterns


Dera sir,
Here is my compose mail page.How to integrate attach file(text or excel) in this page.How to store in the database.How to download it in another page.please help.This is mighty part left in the mail page.Your help is paramount.Please helpa
Thank You
Debasis
jsp page--
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ include file="/security/authenticate.jsp"%>
<%@ include file="/security/TopAndLeftTrans.jsp"%>
<%@ page import="java.text.SimpleDateFormat" %>
<jsp:useBean id="tmsBean" scope="request" class="pms.administration.MailServer"></jsp:useBean>
<jsp:setProperty name="tmsBean" property="*"/>
<link rel="stylesheet" type="text/css" href="/tms/misc/rounded.css"></link>
<link rel="stylesheet" type="text/css" href="/tms/misc/stylemain.css"></link>
<link rel="stylesheet" type="text/css" href="/tms/misc/button.css"></link>
<link rel="stylesheet" type="text/css" href="/tms/misc/report.css"></link>
<title>MAIL INBOX</title>
<%
String messageFromtmsBean="";
String display="";
String userName=request.getParameter("userName");if(userName==null)userName="";
//System.out.println("userName:"+userName);
try{

display = request.getParameter("display");

//System.out.println("Hi:"+display);
String fetchPressed = request.getParameter("fetchPressed");
if(display==null)display="";
if(fetchPressed != null )
{
if(fetchPressed == "yes")
{
tmsBean.setFetchPressed("yes");
}else if(fetchPressed == "no")
{
tmsBean.setFetchPressed("no");
}
}

}catch(Exception e){}

try{
if(display.equals("draft"))
{

tmsBean.draftMail(request);

}else if(display.equals("send"))
{

tmsBean.sendMail(request);

}
}catch (Exception e)
{
//out.println("reached herer");
}

%>
<script type="text/javascript" language="JavaScript1.2" src="/tms/misc/Validate.js" ></script>
<script language="javascript" type="text/javascript" src="/tms/misc/datetimepicker.js"></script>

<head>
<style type="text/css">
.mouseOut {
background: #708090;
color: #FFFAFA;
}
.mouseOver {
background: #E6E6FA;
color: #000000;
}
</style>
<script language="JavaScript1.2">
var globalVar = "";

function createXMLHttpRequest() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function initVars() {
inputField = document.getElementById("names");
nameTable = document.getElementById("name_table");
completeDiv = document.getElementById("popup");
nameTableBody = document.getElementById("name_table_body");
}

function findNames() {
//alert("gb nm "+globalVar);
initVars();

var inptVal = inputField.value;
if(globalVar.length > 0){

var rev = inptVal.split("").reverse().join("");
var commPosition = rev.indexOf(",");
var cStr = rev.substr(0,commPosition);
var corrStr = cStr.split("").reverse().join("")
//alert("reverse "+rev);
var srchStr = corrStr;//rev.substr(1, inptVal.substr(1,inptVal.reverse().indexOf(","));
//alert("scch string "+srchStr);
//alert(srchStr);
}else
{
srchStr = inptVal;
}
//alert("not global var "+srchStr.length);
if (srchStr.length > 0) {
createXMLHttpRequest();
var url = "user.jsp?val=" + escape(srchStr);
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = callback;
//alert("after call back ");
xmlHttp.send(null);
}else
{
clearNames();
}//end of if

}//main function

function callback() {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
var name = xmlHttp.responseXML.getElementsByTagName("name")[0].firstChild.data;
//alert("after set names");
setNames(xmlHttp.responseXML.getElementsByTagName("name"));

} else if (xmlHttp.status == 204){
clearNames();
}
}
}
function setNames(the_names) {
clearNames();
var size = the_names.length;
setOffsets();
var row, cell, txtNode;
for (var i = 0; i < size; i++) {
var nextNode = the_names[i].firstChild.data;
row = document.createElement("tr");
cell = document.createElement("td");
cell.onmouseout = function() {this.className='mouseOver';};
cell.onmouseover = function() {this.className='mouseOut';};
cell.setAttribute("bgcolor", "#E6E6FA");
cell.setAttribute("border", "1");
cell.onclick = function() { populateName(this); } ;
txtNode = document.createTextNode(nextNode);
cell.appendChild(txtNode);
row.appendChild(cell);
nameTableBody.appendChild(row);
}
}

function setOffsets() {
var end = inputField.offsetWidth;
var left = calculateOffsetLeft(inputField);
var top = calculateOffsetTop(inputField) + inputField.offsetHeight;
completeDiv.style.border = "black 1px solid";
completeDiv.style.left = left + "px";
completeDiv.style.top = top + "px";
nameTable.style.width = end + "px";
}
function calculateOffsetLeft(field) {
return calculateOffset(field, "offsetLeft");
}
function calculateOffsetTop(field) {
return calculateOffset(field, "offsetTop");
}
function calculateOffset(field, attr) {
var offset = 0;
while(field) {
offset += field[attr];
field = field.offsetParent;
}
return offset;
}
function populateName(cell) {
inputField.value = globalVar+cell.firstChild.nodeValue+",";
globalVar=document.getElementById("names").value;
clearNames();

}
function clearNames() {
var ind = nameTableBody.childNodes.length;
for (var i = ind - 1; i >= 0 ; i--) {
nameTableBody.removeChild(nameTableBody.childNodes[i]);
}
completeDiv.style.border = "none";
}

</script>
</head>


<form method="GET" name="ComposeMail" action="ComposeMail.jsp" autocomplete="off">
<table align="left" bgcolor="White" width=80% >
<tr>
<td>
<table align="left" width="20%" cellpadding="15" bgcolor="#D0D0E0" >
<tr>
<td>
<FONT size="6" color="Maroon"><b><U>TTMS Mail</U> </b>
</td>
</tr>
<tr>
<td>
<input type="button" name="Compose" value="Compose" style="width:100;" onClick="document.location.href='/tms/administration/ComposeMail.jsp?userName=<%=userName%>'">
</td>
</tr>
<tr>
&nbsp;&nbsp;
</tr>

<tr><td>
<input type="button" name="Inbox" value="Inbox" style="width:100;" onClick="document.location.href='/tms/administration/MailInbox.jsp?userName=<%=userName%>'"></input>
</td></tr>
<tr>
&nbsp;&nbsp;
</tr>

<tr><td>
<input type="button" name="Draft" value="Draft" style="width:100;" onClick="document.location.href='/tms/administration/DraftMail.jsp?userName=<%=userName%>'"></input>
</td></tr>
<tr>
&nbsp;&nbsp;
</tr>
<tr><td>
<input type="button" name="Sent" value="Sent" style="width:100;" onClick="document.location.href='/tms/administration/SentMail.jsp?userName=<%=userName%>'"></input>
</td></tr>

</table>
<table align="center" width="20%" border="0" cellpadding="0" cellspacing="0"
style="border-collapse:collapse;border-color:black;">


<br></br>
<tr>
<td>
<div class="ContentContainer" id="CenterContainer">
<div class="WideSectionContainer" id="WideSectionContainer1">
<div>
<div>
<div id="hpmebaag">
<div class="cchprcp_container">
<div class="hprcp_n">
<div class="hprcp_e">
<div class="hprcp_w"></div>
</div>
</div>

<div class="hprcp_head">
<div>
<span class="mtitle">
<font style="titletext" class="mtitle" size="3">Mail Details</font>
</span>
</div>
</div><div class="hprcp_mid">
<table class="formfields" border="0" align="center" cellpadding="2" style="border-collapse: collapse"
bordercolor="#111111" cellspacing="1">
<tr>
<td colspan="2">
<table border="0">
<tr>
<td>
<table align="center" >
<tr>
<td>
<fieldset id="master" title="Asset Index No." style="width=600">
<legend>TTMS MAIL</legend>
<table align="center" border="0" >
<tr>
<td align="left">Mail From:
&nbsp; <b> <%= userName %>
</td>
</tr>

<tr>
<td align="left">Mail To:&nbsp;&nbsp;
<input type="text" size="70" name="inputText" id="names" onkeyup="findNames();" style="height:50;"/>

<div style="position:absolute;" id="popup">
<table id="name_table" bgcolor="#E6E6FA" border="0"
cellspacing="0" cellpadding="0"/>
<tbody id="name_table_body"></tbody>
</table>
</div>
<tr align="center">
<td>
<input type="button" name="Add cc" value="Addcc" style="width:60" onClick="document.location.href='/tms/administration/MailInbox.jsp?userName=<%=userName%>'">

<input type="button" name="Add Bcc" value="AddBcc" style="width:75" onClick="document.location.href='/tms/administration/MailInbox.jsp?userName=<%=userName%>'">
</td>
</tr>
<tr>
<td align="left">Subject:&nbsp;&nbsp;

<input type="TEXT" name="sub" size="50"></input>
</td>
</tr>
<tr align="center">
<td>
<input type="button" name="Attach File" value="Attach File" style="width:100;" onClick="document.location.href='/tms/administration/MailInbox.jsp?userName=<%=userName%>'"></input>
</td></tr>
</table>
</fieldset>
</td>
</tr>
</table>

<fieldset id="mst" title="Mail">
<legend>Your Mail</legend>
<table>
<tr>
<td><textarea name="remarks" id="remarks" cols="70" rows="20" value="<jsp:getProperty name="tmsBean" property="remarks" />"><jsp:getProperty name="tmsBean" property="remarks" /></textarea></td>

</tr>

<tr>
<input type="HIDDEN" name="userName" value="<%=userName%>"></input>
<input type="HIDDEN" name="display" value="">
<td align="center">
<input type="button" name="Discard" value="Discard" style="width:100;" onClick="document.location.href='/tms/administration/MailInbox.jsp?userName=<%=userName%>'">
<input type="button" name="Send" value="Send" style="width:100;" onclick="javascript:submitClick()">
<input type="button" name="Draft" value="Draft" style="width:100;" onclick="javascript:DraftMail()">
</td>
</tr>
</table>
</fieldset>

</td>
</tr>
</table>
</td>
</tr>
</table>


</td>
</tr>
</table>

</form>

Advertisement
View Answers

Related Tutorials/Questions & Answers:
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
Advertisements
java linked list urgent!!!
java linked list urgent!!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
urgent - Java Interview Questions
display the url one by one.using core java technology (e.g)when am requesting...://www.roseindia.net/java/example/java/io/file-url-download.shtml Thanks
Urgent java programming question.Pls help
Urgent java programming question.Pls help  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list
urgent-Exception in Tomcat - Java Beginners
urgent-Exception in Tomcat  I am using eclipse ee and tomcat server. my jsp pages are working fine.after some time it cant display my jsp pages.it raises following exception.Html pages is working . HTTP Status 500
URGENT: User Defined Classes - Java Beginners
URGENT: User Defined Classes  Can someone help me? Design and implement the class Day that implements the day of the week in a program. The class...://www.roseindia.net/java/java-get-example/index.shtml Here, you will get different data
swing program plz urgent sir - Java Beginners
swing program plz urgent sir   hi sir,i waan a jtable swings program table having column names "itemid","price".Initially table having single empty row.whenever we click the "enter" button automatically new row will be insert
reply me its urgent - Java Beginners
urgent.  hi friend, i think password is wrong or username may be wrong
urgent help needed in JDBC AND JAVA GUI - JDBC
urgent help needed in JDBC AND JAVA GUI  my application allows a student to open a savings account , the student has to submit his or her names... want any one to help me convert from scanner to java GUI for this code
very urgent - Java Server Faces Questions
check it once and give me a correct solution. It is very urgent for me. Thanks
very urgent - Java Server Faces Questions
very urgent  Hi sir, see my code and please tell me mistake. it is very urgent for me. here is my code: addmin.jsp: Users... deepak@roseindia.net 8888 deepak kumar It is very urgent for me please give
&nbsp;(very urgent) - Java Server Faces Questions
 (very urgent)  hi friends, This is my code in JSF                    
plz help -java project very urgent
plz help -java project very urgent  ? Ford furniture is a local furniture store in acts, and they as CS graduate students to implement a software system to generate various reports for them at the end of each month. You
Java urgent - Design concepts & design patterns
Java urgent  Dera sir, Here is my compose mail page.How to integrate attach file(text or excel) in this page.How to store in the database.How to download it in another page.please help.This is mighty part left in the mail
PROJECT ON JAVA NET BEANS AND MYSQL !! PLEASE HELP URGENT
PROJECT ON JAVA NET BEANS AND MYSQL !! PLEASE HELP URGENT  i need a project based on connectivity..it can be based on any of the following topics...://www.roseindia.net/tutorial/java/swing/studentApplication.html
urgent need
urgent need   Input a line. Count the number of words that start with a capital letter
Urgent requirement
Urgent requirement  I want to implement Autocompletion code for Jcombobox in swing can you please help me out from
Urgent Answer Req
Urgent Answer Req  how to view the file content which is at client side from jsp in java
its urgent - Development process
its urgent  Hi how to write a program in core java , program is searching documents and contents in a existing folder or upload a folder... in a folder.its urgent
urgent...pleAse help me.....please!
urgent...pleAse help me.....please!  please help me urgent! how can i do dictionary with the use of array code in java, where i will type the word then the corresponding meaning for that word will appear...thanks
Urgent Solution required
Urgent Solution required  This is possible to transfer that file from client to server and read that file and view it in JSP. If it is can you send the example. thanks alot in advance   Hi, You can create a JSP file
Please help me urgent...........
Please help me urgent...........  For what kind of a problem would use a Tree Set and not a Tree Map For what kind of a problem would use a Tree Map and not a Tree Set   Hello Friend, If you want to display the list
Urgent programming assignment
Urgent programming assignment   Hi, I am an Indian student in USA.I have been able to write all the java codes successfully , however this one is giving me tremors.Any help would be highly appreciated.I am attaching
urgent please, help!
urgent please, help!  how to make jTable unclickable and have unmovable columns, thanks in advance   import javax.swing.*; import java.awt.*; public class SimpleJTableExample{ public static void main(String[] args
Urgent: HttpRequest - JSP-Servlet
Urgent: HttpRequest  Hi, I want to send a http Request. Their will be another program which will receice the request process it and send back the response. Example: I have one page in which I am giving 2 numbers as input
Program urgent - JSP-Servlet
Please please its very urgent.. Thanks/Regards
Advertisements
 

 

 

DMCA.com