JSF :: Page Content In OUTLOOK Body Not Getting Breaks

Jun 3, 2014

I have a requirement. I got a JSF page(parent page). When a button(say SEND EMAIL) is pressed, an email window (OUTLOOK) will be displayed as a popup. I have to populate whatever the text data of parent page as the body of the mail.

I am using mailto method : eg :

Here is my code:
==============
FacesContext context = FacesContext.getCurrentInstance();
HttpServletRequest origRequest = (HttpServletRequest) context.getExternalContext().getRequest();
context.getExternalContext().redirect(String.format("mailto:"+mailTo+"?subject=" + subject +"&body=" + body + "&cc="+mailCc+""));

till here it is fine..

My problem is body part is not getting breaks. I have tried
, ,
, <br>, <br></br> etc.. what ever stuff i found in google..

E.g. my email body looks like below.. it consists of url link also.

====================================================
Hi,

This is to inform you etc... ,

Please follow this Hyperlink link to navigate to your page.. etc.

regards..

======================================================

View Replies


ADVERTISEMENT

N-body Simulation - Forces For Body Not Calculating In Some Instances?

Mar 13, 2015

I am making a n-body simulation. For some reason, when I have two bodies orbiting each other and I add a third body, the two initial bodies stop orbiting each other.

EXAMPLE:

[URL]- earth is orbiting the sun, when I add mars,[URL] earth AND mars does not orbit the sun and both travel in a straight line. Almost as the forces are not being computed at all on the body. How can this be?

Here is the relevant code:
 
public void update(float deltaTime){
for(int i=0; i<bodies.size();i++){
resetForces(); 
bodies.get(i).update((float)(deltaTime / Math.pow(10,9))*timeScale);
lastTime = System.nanoTime();
//sets the forces for all bodies
for(int n=0; n<bodies.size();n++){

[code]....

View Replies View Related

JSF :: XHTML Page - Access To Content Of Dynamic Page?

Jan 15, 2014

I have a xhtml file that initialization it with ui:repeat tag in realtime.all tags of this page placed under ui:fragment tag.

<edges>
<ui:repeat value="#{graphInfoBean.edges}" var="edge" varStatus="indexVar">
<edge id="#{indexVar.index}" source="#{edge.source}" target="#{edge.target}"
weight="#{edge.weight}">

[Code] ....

When i access to this page and save it as xml in realtime, the tags in xml file saved is empty while it is initialized and everything is working properly.

<edges>
</edges>

How can i access to content of this xhtml page and save it on disk?

View Replies View Related

Page Is Not Displaying The Content?

Sep 14, 2014

One of my official site is not disaplying the content in machine#1 IE10 browser.And the same site is showing data in another machine#2. I compared the both machines JRE and JDK settings but no difference found.

how to link the JRE to browser.

View Replies View Related

JSP :: IFrame Content From Servlet Page Is Not Displayed

Mar 28, 2014

In my servlet page I call one xml response from third party server and make write it in file using filewriter and store it in local,after that

response.setHeader("Refresh", "1; URL=test.jsp");

Using this code i goes to test.jsp page ,in that test.jsp file ,i place iframe tag like <iframe src="file:///D:/sample/result.xml" /> but it does not show the content what can i do?

View Replies View Related

Servlets :: Content Type Is Getting Text / Plain When Double Click On Page Not In First Time

Dec 14, 2014

we have deployed application on web sphere server and using servlets and jsp only.

View Replies View Related

Logging In To Outlook WebApp Using ApacheHttpClient

Jun 3, 2014

I've been trying to create a tool that extracts emails from inbox using Apache HttpClient, however I'm stuck at the logging in part itself.This is the code. (I've written it all in a main class and removed exception handling for brevity). More in code comments.

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.CookieHandler;
import java.net.CookieManager;
import java.util.ArrayList;
import java.util.List;

[code]....

Now the thing is, after execution I am returned the login-page again instead of the inbox, which leads me to believe that login did not take place at all.Also the response to the post method in the browser has two cookies "cdata"; "sessionid" populated with values however I get them as empty. I believe that I am losing my session between the first get request and the subsequent post.

View Replies View Related

While Loops And Conditional Breaks?

Feb 12, 2015

public class dowhile2 {
public static void main(String[] args) {
int i = 1;
while(i <= 100){
System.out.println(i);
if(i == 50){
break;
}
i++;
}
}
}

I just want to know how to count this lines of codes. Because if I place for example i++ further up the code or the system.out.println a bit lower the result will be 1-49 or 2-50 and not the goal that is 1-50.

I want to know how to think and count. Why do i get 2345678.........50 and not 12345678........50 or 12345678.....49, thats the question.

View Replies View Related

Open Source Java API For Creating Tasks To MS Outlook?

May 28, 2014

I am looking for pure java API to be able to create/read outlook tasks.

Any open source API's available for the same.

View Replies View Related

Read Encrypted TXT File (Outlook Item) In Java

Aug 4, 2014

I have an encrypted MSCONS.txt file as Outlook item. I also have a Digital Certificate file (Certificate.pfx) with a password.

How I can read the actual MSCONS.txt file in my java application? Any sample code snippet ...

View Replies View Related

Code Breaks After Upgrading To Java 8?

Jan 22, 2015

We recently upgraded to JDK 8. Since then, a section of code in a jsp file breaks. The code is this:

ArrayList all = new ArrayList();
final List tsd = timeSeriesBean.getTSData();
all.addAll(tsd); 
Collections.sort(all, new Comparator() {
public int compare(Object o1, Object o2) {
TSData t1 = (TSData)o1, t2 = (TSData)o2;
int res = t2.getDate().compareTo(t1.getDate());

[code]....

The error message is this:

An error occurred at line: 65 in the jsp file: /TS/VerifyImportTSData.jsp The type new Comparator(){} must implement the inherited abstract method Comparator.thenComparing(Function, Comparator)
 
64:
65: Collections.sort(all, new Comparator() {
66: public int compare(Object o1, Object o2) {
67: TSData t1 = (TSData)o1, t2 = (TSData)o2;
68: int res = t2.getDate().compareTo(t1.getDate());

just trying to maintain some old java code that I can support until it is rewritten.

View Replies View Related

How Boolean Finished Is Set To False And Breaks While Loop

Sep 11, 2014

I'm having trouble understanding how this loop is broken, I can't understand how the boolean finished is set to false and breaks the While loop.

public void run()
{
char answer;
boolean finished = false;
while(!finished)// when false loop is broken

[Code] ....

View Replies View Related

Moving Executable Jar Breaks App Save Function

Apr 1, 2014

I've been trying to deploy my desktop application as an executable jar file but I'm facing the following problem: Whenever I move the jar file from its original build location, my application becomes unable to write to its external files. I initially thought the problem was path related; however, when moved the app can still load data from these files.
 
The solution is probably simple but for some reasons I've yet to find it .
 
The app consists of a jar file and a folder named "files" containing text files (such as library.data) to which serialized objects are written.
 
I wouldn't be surprise if the problem has to do with the xml build file, but all modification I've tried so far have failed. If it is likely that it is the problem, I'll be happy to post a copy of it upon request.
 
public static void saveLibraryToFile() {
    File file = new File(System.getProperty("user.dir")+"fileslibrary.data");
    if (file != null && file.exists()) {
        library = new Library(sortedAccounts, accountCategoriesMap, accountCategoriesList);
 
[Code] ....
 
A mostly complete set of the relevant codes I'm using, including the full Ant xml file, can be found at : [URL] .....

View Replies View Related

Calculate And Display Person Body Mass Index

Feb 12, 2015

I have to write a program that calculates and displays a person's body mass index (BMI). The BMI is often used to determine whether a person with sedentary lifestyle is overweight or underweight for his or her height. A person's BMI is calaculated with the following formula:

BMI = Weight X 703/Height^2

where weight is measured in pounds and height is measured in inches. The program should display a message indicating whether the person has optimal weight, is underweight, or is overweight. A sedentary person's weight is considered optimal if his or her BMI is between 18.5 and 25. If the BMI is less than 18.5, the person is considered underweight. If the BMI value is greater than 25, the person is considered overweight.However I can't seem to get rid of these errors:

----jGRASP exec: javac BMI.java
BMI.java:28: error: cannot find symbol
Scanner keyboard = new Scanner(System.in);
^
symbol: class Scanner
location: class BMI
BMI.java:28: error: cannot find symbol

[code]....

View Replies View Related

Servlets :: HTML Body Onload Not Working In Chrome

Mar 12, 2015

I have written sample web application with servlets and jsp. As per the below code the action url should be executed automatically according to the "onload". I have written this below code in one of my servlet, The below "onload" form hits the path in action only in Firefox and IE but not in Chrome(41.0.2272.74 beta-m (64-bit)).I have seen the link [Chrome - <body onload=“”> is not working ][1] , I have my below code in the end of servelt. there is nothing to execute after this code in the servlet.

out.write("<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
");
out.write("<html><body onload="alert('alert has been fired');document.forms[0].submit()">
");
out.write("<form method="POST" action="" + actionUrl + "">

[Code] ....

Is there any reserved key words of chrome in the above action url? If I execute this code in the html format, it is working in chrome. but if it is from servlet, alert() is not running.

View Replies View Related

Servlets :: GET HTTP Request Contain A Request Body?

Feb 25, 2014

I have the following questions:

1. Does a GET HTTP request contain a request body? If yes what is contained in it? Are the request headers also part of the request body?
2. Is it possible to send a byte array as part of the GET request in its body?
3. Is there a size limitation on the data that can be sent via a GET request?

View Replies View Related

JSP :: Extracting Information About Previous Page From Where Current Page Came

Jan 31, 2015

I have to implement a system where I have to do almost same processing on a jsp page. The slight differences on the present page is based on whether the current page came from page 1 or page 2. So how can I do this?

View Replies View Related

JSP :: How To Open Page Inside Another Page

Apr 1, 2015

I have two jsp page one is demo1.jsp and other is demo2.jsp on a click of a particular link on demo1.jsp I want to opwn demo2.jsp inside demo1.jsp without changing layout of demo1.jsp..I tried to use <jsp;include but that doesn't work for me.But how to do this simply on a single link click on a big page?

View Replies View Related

JSF :: CommandLink - Cannot Change Content

Mar 4, 2015

I'm a first timer at jsf, and right now I'm learning how to use ajax in jsf. i got a problem when i click a command link i want to change in a content, but when i run my web and i click the command link it didn't do anything. This is the source :

<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"

[Code] ....

In this code when i click the Home button it suppose to change the ouput text to a string that store in my bean. This is my bean:

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package UI;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

[Code] .....

At first the output text value is the same as the string i store in the bean. but when i click the commandlink, it didn't do anything, is there something wrong with my code?

View Replies View Related

Reading Content From FTP File?

Jan 27, 2013

I am trying to read a content of file downloaded from ftp and return it as a String. This is what I use:

Java Code:

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.net.ftp.FTPClient;
public class Test {
public static void main(String [] args) throws IOException{
FTPClient ftp = new FTPClient();

[code]....

The code does not work, although all the links are correct.

View Replies View Related

How To Read Content From A Website To App

Nov 27, 2014

I am working on a little project to create an App that can read contents from a website and return it back to my app. What protocol to use for that. Just the reading/retrieving content from a website.

View Replies View Related

Cannot Read Zip Files Content

Dec 30, 2014

I am fallowing programming tutorials on youtube.And this code is for reading zip files content.I did the same things like in the video.But Code dosent work

try {
ZipInputStream zis=
new ZipInputStream(new FileInputStream("C:UsersxxxDesktop ry.rar"));
ZipEntry zip;
while((zip=zis.getNextEntry())!=null){
jTextArea1.append(zip.getName());
zis.closeEntry();
}
zis.close();
} catch (FileNotFoundException ex) {
Logger.getLogger(Zip.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Zip.class.getName()).log(Level.SEVERE, null, ex);
}

View Replies View Related

Lined Out Content In Eclipse

Aug 26, 2014

I am new to Java and Eclipse. What does lined-out lines mean?

View Replies View Related

JApplet Content Blocked

Feb 6, 2014

I just created an applet that I want to call from a html file.The applet code looks like this (and works):

Java Code:

package jav12
import java.awt.*;
import javax.swing.*;
public class Welcome extends JApplet {
public Welcome(){

[code]...

When I click on the html file the content of the page is blocked and the applet isn't loaded. URL...

View Replies View Related

JSP :: How To Get Content Type Of Jar To Download That File

May 21, 2014

String contentType = fi.getContentType(); gives text/plain when my file is.txt file and gives image/jpeg when my file is .jpeg file but when my file is .jar or .docx it will return application/octet-stream and application/vnd.openxmlformats-officedocument.wordprocessingml.document respictively so what to do to get exact mime type.

View Replies View Related

Store Content Of JTextField To Char

Mar 9, 2015

I was trying to store the content JTextField on char..... Here's the instruction of program--->>create a GUI program that convert letter into corresponding no. EXAMPLE:

if user enter "c" then it will output "3"......
like a=1,b=2,c=3,......

Here's my code

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class convert extends JFrame {
private static final int width = 400;
private static final int height = 300;
private JLabel EN,EQN;

[code]....

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved