JSP :: How To Give Reference Of JavaScript And CSS File In Page

Aug 14, 2014

I have just started to work on Java EE and I am not able to put the refrence of css and javascript in jsp page.

My senario is below: I have created script file inside myJavaScript Folder like Web Container-> myJavaScript ->Home.js. Similarlly for css:Web Container-> myCss ->Home.css.

My Jsp page palced inside Like: Web Container-> Home ->Home.jsp.

How to give the reference of js and css file in my Home.jsp page.

View Replies


ADVERTISEMENT

JSP / JSTL :: Page Set Bean Variables But Give NullPointerException When Bean Try To Merge In DB

Nov 21, 2013

I'm new to JSP but I've to use it to grab data coming from an external site, pass data to a Bean, write data in a DB and redirect the user to another page. Follow the JSP page.

<%@page import="EJB.getResponse"%>
<%
long paymentID = Long.parseLong(request.getParameter("paymentid"));
String responsecode = "9999";
getResponse g = new getResponse();

[Code] ....
 
This is the bean:

@ManagedBean
@RequestScoped
public class getResponse implements Serializable {
private Long paymentId;
private String result;
private String auth;

[Code] ....
 
On the console I see the prints but I receive the NullPointerException

WARNING: StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at EJB.getResponse.printData(getResponse.java:72)
at org.apache.jsp.notify_jsp._jspService(notify_jsp.java from :60)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)

[Code] ....

View Replies View Related

Can't Give Input A File By Console

Sep 28, 2014

this is my code...in my code i cant give input form my console...it takes input but it doesn't save in a target file..My code is :-

package filetester;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
 
[code]....

View Replies View Related

Give A Complete Resource Of File I/O Serialization

Aug 15, 2014

Can you tell me or give a complete resource of file I/O, serialization!

View Replies View Related

Web Services :: XML Input File - Parse It And Give Response To Client

Dec 12, 2014

New to webservices. Can i get to create webservice which takes xml input. Parse it and gives the response to client.

View Replies View Related

JSF :: Reference Variable Passed To A File

Sep 30, 2014

How are methods invoked on the `bird` parameter?

next.xhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">

[Code] ....

`MyQueueBean` is intended to give out a bird once only, to exactly one end-user. Because it's application scoped, and not session scoped, getting attributes directly from the bean would give inconsistent results.

The birds application is from Facelets Essentials Guide to JavaServer Faces View Definition Framework: [URL] ....

how is the variable passed to the file? Once it's passed, how is it referenced?

View Replies View Related

JSP :: How To Browse And Read A File In Page To Perform Encryption For File

Nov 12, 2014

I am trying to create a file browse option in my jsp and later after browsing, all i want to do is to read that file in my jsp without saving it into that database so that i can perform encryption for it and save that encrypted file later into my database. please provide reference link so that i can refer to some applications and and move ahead with my work.

View Replies View Related

Sending A File To Web Page

Feb 20, 2014

I am new to java (been Reading for 2 days now), and have almost no knowledge on programming (I am a Mechanical Engineer).The problem I have is that I have to upload 5,000 files to a web page (each one is name B001400XXXX.pdf in consecutive order).I have managed to access the web page and select a few form elements using watij, but I am having a hard time sending my pdf file to the server. This is what I have so far:

Java Code:
import org.watij.webspec.dsl.WebSpec;
public class NewClass {
public static void main(String[] args) {

[code]....

View Replies View Related

JSP :: How To Access Variable Of Java File Into Page

Jul 4, 2014

I want to access variable of java file into jsp Page. So I tried to do this but it does not work.

Problem : when I am trying to access "getName" method of java class into jsp file it displaying error, i already imported "Ajaxmethod.java" file in to "success.jsp" I want to access "getName" method in to jsp file without creating object of class.

Ajaxmethod.java
package a.b;
public class Ajaxmethod implements Action{
public String name;
public String getName() {
return name;
}

[Code]...

View Replies View Related

Sending A File To Web Page Using POST Method

Jun 22, 2011

I have an application and I would like it to send a file to a web page using POST method.

I've found the HttpClient from Apache, but I had no luck. All the tutorials and samples I can find on the net are for 3.x. I've tried adopting the samples with the HttpClient 4.1 docs, but I failed.

I have a target url of a page and source file path. I get the basic idea of what needs to happen, I am just finding it hard to implement it.

View Replies View Related

JSF :: File Upload And Prevent Refresh Calling Page

Apr 1, 2014

I have a JSF page (called MainPage) with a commandButton: clicking on it, I open a modal panel with a <Rich:fileUpload> component, related to a listener in corresponding bean.

When I start to upload a file, page MainPage starts to refresh, but I would like to prevent this because it's not necessary.

I tried to "play" with <Rich:fileUpload> property values, but nothing seems to work and I don't know what to do anymore.

Here is file upload component

<rich:fileUpload fileUploadListener="#{pannelloUploadBean.uploadListener}"
id="#{cid}_input"
ajaxSingle="true"
immediateUpload="true"
listHeight="200px"
listWidth="458px">

[Code] .....

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

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

How To Give URL Connection To Code

May 11, 2014

how to give URL Connection to this?

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.net.*;
import java.io.*;
import javax.swing.*;
import javax.swing.event.*;
public class WebBrowser

[code]....

View Replies View Related

Way To Give A Color To The JFrame

Nov 23, 2014

i've worked with java for 1 month, i'm designing some practices at Netbeans IDE. my problem is i tried to make a single colorful interface using panels, adding colors and i want to know if i exist a way to give a color to the JFrame (i tried to use the background color option but this didn't work).

View Replies View Related

Why Array Initialization Does Not Give Error

Feb 18, 2014

int[][] array1 = {{1, 2, 3}, {}, {1, 2,3, 4, 5}};

it initializes 3 one dimentional array:

1 - {1, 2, 3}
2 - {}
3 - {1, 2,3, 4, 5}

but it only declares two dimensional arrays.

View Replies View Related

How To Rotate Object And Give Colour Inside

Mar 13, 2014

package id.ac.ub.ptiik.computergraphics;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.util.glu.GLU.*;
public class CG04_3DTransformation extends CGApplication {
protected boolean wireframe = true;

[Code] .....

View Replies View Related

How To Give Values To Array Objects Without Using Loop

Apr 3, 2014

The main method should creates a Student object with name as "Bill" and marks as {88,92,76,81,83} and print it.

Java Code:

class TestStudent {
public static void main(String args[]) {
Student1 st = new Student1();
st.name = "bill";
Student st1[] = new Student[6];
//This gives error
st1[].marks = {1, 5, 8, 9, 7, 6}; mh_sh_highlight_all('java');

View Replies View Related

Stack Assignment - Give More Than One Option To Input

Sep 10, 2014

I understand the stack part of it, just not the loop, specifically how you give the user more than one option to input.

Implement a printer driver that handles incoming print jobs. The driver will behave in the following manner:

- Loop giving the user the following options: ADD print job, DELETE latest print job, and
QUIT
- Recording the following information from each job: computer name, document name, and
number of pages
- When the user chooses to ADD, add a new print job to the top of the stack
- When the user chooses to DELETE, pop off the latest print job and output to the screen
which job has just been deleted
- When the user chooses to QUIT, output the print jobs still in the stack (in order from top
to bottom)
- Output must include all relevant information for each job.

View Replies View Related

Give Number Of Numbers Dividable By Either 2 / 3 Or 5 In A Range

Oct 31, 2014

I found an exercise online to create a small program . I have this code that I have done so far:

import java.util.Scanner;
 public class Test {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
long a = sc.nextLong(); long b = sc.nextLong();
long count = 0; // counter
for (long c = a; c <= b; c++) {
if (c % 2 == 0 || c % 3 == 0 || c % 5 == 0) {
count++;
}
}
System.out.println(count);
}
}

This program is suppose to give me the number of numbers which are dividable by either 2,3 or 5 in a range of a to b, where a<=b.

FOR EXAMPLE: a=5 b=8 ... output: 14 (since there are 14 numbers in between 5 and 8 which are dividable by either 2,3 or 5.)

It works great for all of the numbers except higher ones such as a=123456789012345678 b=876543210987654321. Here it doesn't give me any output. From what I know it is because the code is still running. But there must be a quicker way ...something that can modify the code so it finishes in the matter of seconds not hours. Something that will fasten the process of checking if the numbers are dividable...

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

Swing/AWT/SWT :: Draw 3 Triangles On Top Of Each Other To Give Appearance Of A Tree

Nov 22, 2014

I'm having trouble in 2 areas.

I'm trying to draw 3 triangles 'on top' of each other to give appearance of a tree. My code is below and struggling with how to set my x/y cords correctly.

Also I've drawn a rectangle under a new class and that should then be appearing in the south location of my border layout (south) - but it's not.

import javax.swing.*;
import java.awt.*;
public class Christmas1 extends JFrame {
JPanel titlePanel;
JLabel title;

[Code] .....

View Replies View Related

Error Constructor Class Cannot Be Applied To Give Types

Jun 12, 2014

I'm getting an error on line 51 and don't know what it means?

/*
* 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 million;
import java.util.Scanner;
import java.util.ArrayList;

[code].....

View Replies View Related

Swing/AWT/SWT :: Give JTextArea Focus - Using It On A Panel And With JToolBar

Apr 21, 2014

I have a program with a main panel JPanel that implements KeyListener. I added a JTextArea to which I added as the KeyListener: this, meaning the main panel. I made the JTextArea fill the entire main panel because I want to catch a key press anywhere in the main panel.I catch the key presses and the program does what I want it to.

I added a JToolBar to the program; it is working just fine.Now that I have two components on the main panel - toolbar and panel with textarea -, the textarea must have the focus before it will send the KeyEvent and call keyPressed(). I don't want to expect the user to click on the main window to get the program to start or after each time they use the toolbar.

I have tried calling both requestFocus() and requestFocusInWindow() on the textarea; neither call worked. I put the toolbar at PAGE_END instead of PAGE_START; this worked to allow the program to start but I don't want to have the toolbar at the bottom and once I clicked on a toolbar button, the textarea lost the focus.

I need to be able to give the textarea the focus when the program starts and after the user uses a toolbar button. (I suspect that if I solve the problem when the program starts, I can use the same method after handling a button press.)

View Replies View Related

Guessing Game (numbers Between 1 And 100) - Getting Results To Give Correct Int

Feb 10, 2015

I've been working on a program where you can interact with the computer and play a guessing game of numbers between 1 and 100. It's mainly finished, I just need to add in my comments and stuff. My one problem about it that I cannot figure out is trying to get the results to give the correct int. At the end of the game, it's supposed to return the user information about how well they did like this:

Overall results:
total games = int
total guesses = int
guesses/game = double
best game = int

best game should give you the least amount of guesses you had during a particular round of the game. Here is what I have so far:

import java.util.*;
public class Guess {
public static final int MAX = 100;
public static void main(String[] args) {
intro(MAX);
Scanner console = new Scanner(System.in);
int tempBestGame = 0;

[Code] .....

View Replies View Related

XML :: How To Give Java Document Schema For XPath Queries

Feb 5, 2013

javax.xml.parsers.DocumentBuilder can build a document from a single stream which is the XML file. However, I can't find any way to also give it a schema file.

Is there a way to do this so that my XPath queries can perform type aware queries and return typed data?

We presently use dom4j/jaxen and it does this fine but I figure we should switch to the standard Java runtime if this has been added.

View Replies View Related







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