I'm using Netbeans with glassfish server 4. When i try to launche the web page, i see that "nome" is not printed... Why? My older projects that uses EL, still works fine, while this wont' parse the syntax... why??
In my Icefaces 3 application I have a ManagedBean ancestor that defines common attributes to those they spread it. Including CSS styles to be apply at the menu as icons depending on whether they are selected or not. Classes that extend the CommonMBean class define styles. My question is what do I have to put in the language experssion styleClass to tell him that the getter to use is that of the parent class.
CommonMBean.java package com.omb.view; public class CommonMBean private String menu1Css = ""; private String menu2Css = "";
String name = "James Bond"; Session.setAttribute("name", name);
Why is the attribute name and attribute value the same in all the books I've read. I know one is a string literal and one is an object but must it be the same?
Second thing I'm confused about... let's say I change the servlet code to
String name = "James Bond"; Session.setAttribute("hisname", name); When I try to access it using JSP: ${sessionScope.name}
it works fine. So what is the point of the first argument in Session.setAttribute() ?
Which of these is not a real differentiator for programming languages:
a) Object-oriented / Process-Oriented b) Interactive / Automated c) Interpreted / Compiled d) Strongly-Typed / Weakly-Typed e) All of the above f) B and C g) B and D
Almost all support OOP, Interactive/Automated, Interpreted/Compiled but not sure about Strongly typed/Weakly typed.
I have a class called "HelloController" and it extends SimpleFormController. I have the following method inside of HelloController.java:
protected Map referenceData(HttpServletRequest request) throws Exception { Map<String,String> language = new dHashMap<String,String>(); language.put("Spanish", "Buenos Dias"); language.put("French", "Bonjour"); return language; }
How would I create a JSP file that would accept a language as its input and return a greeting in that language? For example, if the user enters "Spanish", then the user should see "Buenos Dias." If the user enters "French", then the user should a see "Bonjour".
->When the user request for a file that is not exists i want to redirect to a valid url where i can inform him that the file does not exists. ->I am trying to use the properties messages for the language that the user has. I want to use it cause i want to reuse some of the message and it is easier to translate the page to other languages. How when the browser has a default page English to let user change the language to Italian for example but for all page.
Is there any way to add duplicate keywords (for all java keywords) maybe in a different language such that we can program java in a different language.
I am trying to use a for loop for getting hours for an employee for five days. how to convert my pesodocode into java language so that it will compile. This is what my pesodocode looks like:
begin getHours() for(index=0; index <5; index++) get hours **System.out.println() **inputString = input.readLine() **plumbersHours[index] = plumbersHours [index] = integer.parseint(inputString) endfor index = 0 while (index < 5) totalHours + = plumbersHours[index] index++ end while return
I'm learning about inheritance and on this problem I first have to create a class where I get/set methods and get user input for the data fields.
I suppose I should know it at this point but I don't know how to get the users name when they input it. I copied the whole code but the issue is at line 51.
import javax.swing.JOptionPane; public class Order { private String customerName; private int customerNumber; private int quantityOrdered; private double unitPrice; private double totalPrice;
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?
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?
Looking for some simple use cases for servlet filters other than tracking requests ? I was thinking of using a filter to filter out offensive language from entered text. Would that be a good use case ?
I have date in string ex: 2014-08-08T17:38:58.316+05:30 and want to convert into 2014/08/08 17:38:58. I am using below code :
String date1="2014-08-08T17:38:58.316+05:30"; SimpleDateFormat formatter, FORMATTER; formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); String oldDate = "2011-03-10T11:54:30.207Z"; Date date = formatter.parse(oldDate.substring(0, 24)); FORMATTER = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss.SSS"); System.out.println("OldDate-->"+oldDate); System.out.println("NewDate-->"+FORMATTER.format(date));
this giving me required value, but when i replace oldDate with date1 it shows me exception that not parse to date. Actually i am getting date in string of 2014-08-08T17:38:58.316+05:30 which i need to convert into date 2014/08/08 17:38:58. To convert into date i am using below code :
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/M/yyyy hh:mm:ss"); Date datecomp1 = simpleDateFormat.parse(String );
The issue is to convert 2014-08-08T17:38:58.316+05:30 into 2014/08/08 17:38:58.
I want to parse a java file (i.e., I need write some code which understand the content of a given java file--> the name of this java file will be entered as input). Then, after my code understand the content of the given java file, map this java file into another target language or platform. the output from my code is the new file which can run on the target language or platform.in the current state, I want to write some code which can understand a java file and can parse its content and display it on the console.
I am new to java. is there any possibility to store parse tree in database such as mqsql, oracle, etc. My requirement is [URL] ..... I found some code about generating parse tree. my next step is store that tree in database.
I'm just starting out with learning how to process/parse XML data in Java, following online code/tutorials. I am currently only printing out "catalog."
I'm trying to pull the authors from this Json object but I'm having issues trying to pull the author only, I'm only able to get a huge string which is a valid JSON object i tested it in [URL]
I'm working on a method that would parse the value of the array of object that I passed through a parameter. I would like to ask if making Object as a parameter is doable. Let's say I have a class Student and Teacher. I created a class the would handle the sched and name it class Schedule and extend this class to the Student and Teacher. Now I want to have a function that will accept an array of Schedule from either Student and Teacher, what ever object I will pass in the parameter. I know its easy to just make a method with a separate parameter of my classes but im looking for a more dynamic code.
class Student extends Schedule{ //variables here for student } [code]
class Teacher extends Schedule{ //variables here for teacher } [/code]
private void parseObject(ArrayList<Object> objct){ Schedule temp = objct.get(0); //there is no error in this part
}
Now when i will try to use the function and pass a data, it will not accept since my parameter should be an array of object. How would I twist dis one?
ArrayList<Student> temp_student = new Array.... parseObject(temp_student); // it will not accept my parameter, how would i make it as an object
I will be developing a change and would like to know how can i parse a mail header in OBPM using java.
I want to get the message id, date and time the email recieved and email size.
Our code is already fetching the attachment of the email using the following syntax.
mailAttachments = mail.attachments;
I tried creating a variable like mailHeaders = mail.headers, would you know how can i get the details i want by parsing the variable? so far I wasn't able to check what mail.headers return as i'm currently having issues running our code locally due to DB connections.