JSF :: Extension Of Pages In URL?
Jan 22, 2014
I am working in JSF and I've forgot few of the basics :'I use eclipse IDE to develope JSF projects. When I used to create a JSF file, it's extension is basically .jsp and when I ran that file in server .jsf extension used to be displayed in url. But recently, when I did the same thing I got .jsp extension in browser. in web.xml
when url-pattern is the following, .jsp extension is shown, eg: FileName.jsp
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
but when I change the url-pattern as per following, .jsf extention is shown , eg: FileName.jsf
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
even if I change the url-pattern to abc or xyz, the webpage url is shown in that format. eg: FileName.abc this is the actual scenario to specify extension of a jsf page, or is this an error.
View Replies
ADVERTISEMENT
Sep 9, 2014
I am trying to write a webservice class which actually handles multipart requests. T client will try to upload zip or tar.gz files which may be upto 1GB in size.
I dont want to validate the extension i client side.
I want to validate the file extension in server side and discard the request before the file is uploaded.
How can I do this?
View Replies
View Related
Apr 16, 2008
recently I noticed that most of the Sun site pages have the extension .jspa, some even have .xml.So just curious about it because I don't know about jspa but as far as I know of xml, it is not rendered by browser like the way we see on Sun site.
View Replies
View Related
Jul 30, 2014
I have a program that allows the user to select what type (i.e. tif, jpg, sid) of file they have to load. I use a JCombo box for the selection type. I send this JCombo box string to my ElevationConvert class. What I want to do is check to see if that extension the user selected exists prior to converting it. If the file extension does not exist, I want to pop up a window (JOptionPane) stating is does not exit. I have tried suggestions found on this site, but does not seem to work for my application. The program works with (Process cN = Runtime), if I try not to check for the extension. But when I add the check for (If, else), it bombs. This executable runs in the main folder. The file extensions are in a subfolder called Ned.
/*
* 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 terraindbbuilder1;
import java.awt.Component;
import java.io.*;
import java.io.IOException;
import javax.swing.JOptionPane;
[Code] .....
View Replies
View Related
Jan 22, 2015
I want to programmatically change the default program which an extension is opened in. So .resantic extensions for example to run in my jar file when I double-click on it. I know i need a bat file or exe file because i can't directly run the jar file. But i was wondering if its possible to run it if its an executable jar file. Else i can just make a bat file that runs my program. Also how can i on double click send the path to the file that was clicked in the args[] array so i can open the actual file aswell instead of just opening the program?
View Replies
View Related
Nov 3, 2014
I have a GUI that has three jTextFiled's. The first on gets filled in with a file that I choose and shows the path to that file with the file name
i.e. - c:
s34bil.exe
un estrun.i
I want to change the file extension from .i to .r in one jTextField and then .i to .o in another jTextField.
I am slowly learning Java. I have this coded in VB, but not sure how to do it in java.
Here is the VB script :
Dim thefile As String = txtInput.Text
Dim fn1 As String = My.Computer.FileSystem.GetName(thefile)
Dim fn2 As String = fn1.Replace(".i", "")
[Code] ....
View Replies
View Related
Jun 7, 2014
i want to find an embedded file extension i.e suppose if word file is there in that excel is also included then is should detect both file types word n excel and is is it possible to find an embedded file type.
View Replies
View Related
Apr 6, 2015
I am currently working on an application with java and I want to do is upload and download details in .xlsx file. Uploading process is successfully worked but the problem is that when I download the file .xlsx with details at opening the file it gives me the following message :
Excel cannot open the file '(filename)'.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.
View Replies
View Related
Sep 19, 2014
I need to be able to select a file (compressed), change its file extension (to zip) and load all its content, preferably as objects. If it makes things easier one can assume all these files to be of the same type.
The content of the zip file are placed in folders, known Beforehand which might make things easier.
View Replies
View Related
May 21, 2014
I'm trying to make a search engine that will search my computer given a path with any options i decide. So if i decides to look for the file name "resume" with extension "pdf", it will give me the files in the directory, including subfiles.
import java.io.*;
import java.util.*;
import java.text.*;
public class mySearch
{
private final static int path = 0;
private final static int name = 1;
[Code] .....
View Replies
View Related
Feb 28, 2014
I have a large product with many maven projects, all of which can be hierarchically tracked back to the same parent. The projects have javadocs and whatnot.
Icommand line instructions (Windows 7) to generate the full API documents html on my local machine (of all the projects together). If there is a maven command for doing this from the CMD, more the better.
View Replies
View Related
Apr 22, 2014
How to find the total number of pages in java script .how to achieve it.
View Replies
View Related
Jul 19, 2014
So I have an application where the user logs in (using j_security_check). User is taken to a welcome page where user's name is displayed as a link. When clicking that link I would like to take the user to a page where the user is able to update the credentials (password, address, etc). In this way the user only has access to the link related to that specific user's credentials. I am trying the following structure:
The welcome page (adminindex.xhtml) is:
<h:form>
Welcome to admin <h:commandLink value="#{userb.loggedUser}" action="#{userb.selectedUser}"/>
<f:param name="userName" value="#{userb.userName}"/>
</h:form>
The user backing bean:
public String selectedUser() {
userName = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(userName);
selUser=uServ.findByName(userName);
return "UpdateUser";
[Code] ....
The last line of the stack suggests that a null PK value is being picked up by the FacesContext method in the backing bean. I'm confused because the userName string IS the primary key of the user table which is structured like this:
CREATE TABLE sha_users
( username VARCHAR(255) NOT NULL
, password VARCHAR(255) NULL
, PRIMARY KEY ( username ) );
I'm sure I'm getting the concept of how to pass query parameters...
View Replies
View Related
Jul 20, 2010
i want to create a program in java which counts the number of prints taken from a printer..
View Replies
View Related
May 15, 2014
I have an application where the WebContent folder has a number of .jsp pages like navigation.jsp, primarytabs.jsp etc.
The navigation.jsp contains a vertical menu and the primarytabs.jsp contains a tab on top, and some other jsps contain individual components.
When I run the application of the application server, it opens up a welcome page, and all these navigation items, and tabs and others merge into a single view and show us a well formed combination of all these components.
I did some studying and read about "composite views". But I wasn't sure if I can call this composite view or not.
How JSF combines all these jsps into one view and where to find that "binding" within the code so I can make the relevant changes?
View Replies
View Related
Mar 18, 2014
I have a question about how to check for a session as the user goes through different pages. I am using Java beans and EL to pass data from page to page but I cannot figure out how to check for a session on the pages without the use of a scriptlet with an if else statement in it.
I do not want the user to be able to access any pages unless they are logged in. With a scriptlet, I can create a statement that says if session exists show name else redirect to login page.
From what I have read and what some of the wonderful members here have told me, scriptlets are a big no no these days. So, how do I do these without the use of a scriptlet?
View Replies
View Related
Feb 18, 2014
I need to parse an html web page to extract specific information from the tags in Java. For example,
<b>Species </b> Strain </td>
I need to look for the Strain info (Strain is variable in length) in the page. The whole web page is stored as a huge string. I need a regular expression that can identify all the Species and retrieve their corresponding strain info. how to do this or can propose some clever string manipulation methods in Java.
View Replies
View Related
Oct 20, 2014
I am working on this experiment code, I keep getting an exception:
run:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -256
at .MemoryManager.read(MemoryManager.java:68)
at .MemoryProcess.callMemory(MemoryProcess.java:39)
at .main(Lab3.java:29)
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
The offending line is data=RAM[physicalAddress]; inside MemoryManager.java.
why this is exactly happening and thus correct my piece of code.
The code:
main.java
package experiment;
public class Main{
/**
* @param args the command line arguments
[Code].....
View Replies
View Related
Apr 3, 2015
I have a Registration Form in which I am registering user to perform some sort like Entering messages I want to perform some Server Side validation.
Like suppose a user has Enter an Id then as soon as he start entering the Id then I want that this Id should be checked in database that if this Id exists in database or not.
and similar types of validation I want to apply on other fields to.
How can I acheive this?
View Replies
View Related
Feb 23, 2014
I have a Java application and it uses various Freemarker templates to created Web pages for a Web site. Here is a snippet of one of my Freemarker templates that will display the fee description, fee charge, and an add button. The fee has to do with charges that pertain to automobiles. When I click on the "Add" button, I will be taken to another Web page. How would I send the fee.description and the fee.charge to the other page when I click on the "Add" button?
<tr class="${rowclass}">
<td class="leftalign">${Fee.description}</td>
<td class="centeralign"><#if Fee.charge??><#if Fee.charge?trim?upper_case != "No Charge"?trim?upper_case && lot.workOrderFee.charge?trim?upper_case != "Market Price"?trim?upper_case >$</#if>${Fee.charge}</#if></td>
<td class="rightalign">
<input type="button" name="buttonsub" id="buttonsub" onclick="javascript:window.location='myPage.html'" value="Add"/>
</td>
</tr>
View Replies
View Related
Nov 7, 2014
I have a server written in java and can display html pages. but when i try to add css to the page the server doesnt use it.(not my code). Do you have to flag the browser to use css or something?
public class SimpleWebServer extends Thread {
public static final String VERSION = "SimpleWebServer";
public static final Hashtable MIME_TYPES = new Hashtable();
static {
String image = "image/";
MIME_TYPES.put(".gif", image + "gif");
MIME_TYPES.put(".jpg", image + "jpeg");
[Code] .....
View Replies
View Related
May 1, 2014
I have a random list of links whose title I am getting from the database. I'd like to catch one of these links when the user clicks one of them and process it from a single jsp file. Possible?
<ul>
<%
Random random=new Random();
TreeSet<Integer> ts=new TreeSet<Integer>();
for(int i=0;i<8;i++) {
randomInteger=al.get(random.nextInt(al.size()));
ts.add(randomInteger);
[Code] ....
E.g.: when user clicks one of these links, can I dynamically call a web page that fetches information from the click and gets values from a database and insert it on JSP page....
View Replies
View Related
Oct 16, 2014
How to make margin and next pages on printable in the java application???
View Replies
View Related
Apr 15, 2014
Trying to implement PageRank in a naive manner with graph nodes as pages and subsequent calculations. Correcting the code.
import java.util.*;
import java.io.*;
class PageRank {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter no.of pages");
int n=sc.nextInt();
[Code] .....
View Replies
View Related
Sep 7, 2014
I have huge PDF files which are in booklet format. Example:
Assume a booklet pdf file has 24 pages which each page contains 2 pages which is in two sides - left side and right side.
The first page has 48th page number on the left side and 1st page number on the right side
The second page has 2nd page number on the left side and 47th page number on the right side
The third page has 46th page number on the left side and 3rd page number on the right side
I have vertically cut the Booket PDF files in to separate individual PDF files using bulk operation in separate folder.
for example, the cutted PDF file will be as follows in the above case
1st pdf file - 48th page
2nd pdf file - 1st page
3rd pdf file - 2nd page
4th pdf file - 47th page
5th pdf file - 46th page
6th pdf file - 3rd page..
Similarly for other PDF files too....if a PDF file has 95 pages....
the first page has 95th page number on the left side and 1st page number on the right side
Now the issue is how to rename and arrange the files correctly in the sequence for EACH PDF file so that we can merge the PDF file as one at last for each PDF file...
After renaming correctly in the proper sequence for the above file
1st pdf file should point to 1st page
2nd pdf file should point to 2nd page
3rd pdf file should point to 3rd page...
The problem is all the PDF files which we are planning to split will have different set of pages..example
PDF1 file - has 48 pages as above -> files should be renamed and arranged as 1, 2, 3, 4...48 correctly
PDF2 file - has 96 pages -> files should be renamed and arranged as 1, 2, 3, 4.....96 correctly
PDF3 file - has 56 pages -> files should be renamed and arranged as 1, 2, 3, 4.....56 correctly
Program which will rename the vertically cutted files in a proper sequence??
View Replies
View Related