hi,
Friends I need to configure my project with JDK 1.6 version.In this project I have to use tomcat server which version of tomcat is compatible with Java 1.6.
I'm learning Spring MVC at the moment and comparing it to ASP .NET MVC. Is there a way to use partial views in java (like .ascx partials in ASP .NET MVC), so i can associate it with action method of some controller and pass model data to it.
Hi All
I want to generate image on server side. My Image is stored in server side's database in blob format and I am able to convert it into string_image;
Then How to convert that string_image into actual .jpg or .png format.
Actually I am posting attachment as image on users facebook' wall.
How to generate Image at server side in Java?
Is there any sample code to do it?
Why did Sun (now owned by Oracle, I know) develop the Java Plaform? How does it make business sense? It seems to me like it would be a very expensive project (also, any ideas on how much they spent/are spending to develop/maintain the platform?). Are they making money by selling support or something?
I've been trying to explain Java threading to a colleague who has never been exposed to multi-threaded applications, but apparently I'm not a very good teacher.
Can anyone recommend a good online or offline resource that can explain threading in a simple, step-by-step manner? I know it's a complex topic, but surely there exists an article, book, or other explanation that can result in an "Aha! I get it, finally!" moment.
Hi,
I'm having a bit of a strange problem with an application using the Files.probeContentType(path)-method to test for file type: On both my Ubuntu and Fedora systems, it works fine, but when moved to a RedHat Enterprise server (2.6.18-194.el5 #1 x86_64 x86_64 x86_64 GNU/Linux), it only returns null. I'm using java 7 early access (1.7.0-ea-b84). I have to use this version due to functionality that isn't included in 1.6.
Does anyone have an idea of what might be the problem here?
In a set of radio buttons of the same group, only one can be selected at the same time. I would like to have the same behaviour with a normal button.
Imagine there's a row of 3 buttons. When a button is selected it changes: but.setSelected(true) and the other two buttons should be NOT selected: but.setSelected(false)
Now, is there a generic, simple and clean solution to accomplish that in Java (Swing) ?
OK so here's my code: http://www.so.pastebin.com/08ghTkQL
When I press UP, DOWN, LEFT, or RIGHT... the applet redraws itself and positions the new player... sometimes when I do this (pressing buttons), the whole java applet flickers.... how do I stop this?
Thank you.
Would any one please explain this instruction for me:
for (;;)
I have encountered several kinds of these mark (like in ajax code of facebook and in concurrent stuff of Java).
How can I display the graphical "enter symbol" within java applet using fonts?
I want to show "?", which is U+21B5 DOWNWARDS ARROW WITH CORNER LEFTWARDS. –
I want to draw this to applet's screen so that it works in WIN, LINUX, MACOSX, etc.
Is there a font available that makes this possible or should I draw it manually somehow?
g2d.setFont("SymbolFont??which one");
g2d.drawString(myenterSymbolHere,x,Y);
Hi!
My page:
...
<div id="header">
<!-- content header -->
</div>
<div id="content">
<h:messages />
<h:ouputText value="#{example.text}" />
</div>
...
My managedBean:
public class ExampleManagedBean(){
private String text;
public String getText(){
FacesContext.getCurrentInstance().
addMessage(null,
new FacesMessage(FacesMessage.SEVERITY_WARN,
"Warning message...", null));
return text;
}
public void setText(String text){
this.text = text;
}
}
My problem is that the warning message not is rendered in page. Why?
After installing Eclipse e4 Tools in my Eclipse 4.1.2 from update site. I am getting error when launching the eclipse.exe "An error has occurred. See the log file <my_workspace_path>\.metadata\.log". And the content of .log file are:
!SESSION 2012-04-06 16:00:01.609 -----------------------------------------------
eclipse.buildId=M20120223-0900
java.fullversion=J2RE 1.6.0 IBM J9 2.4 Windows XP x86-32 jvmwi3260sr5-20090519_35743 (JIT enabled, AOT enabled)
J9VM - 20090519_035743_lHdSMr
JIT - r9_20090518_2017
GC - 20090417_AA
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86 -clean -console
!ENTRY org.eclipse.osgi 4 0 2012-04-06 16:00:17.343
!MESSAGE Application error
!STACK 1
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1
at org.eclipse.emf.common.util.URI.segment(URI.java:1731)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.getBundle(ReflectionContributionFactory.java:135)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:61)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.processHierarchy(E4Workbench.java:196)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.init(E4Workbench.java:122)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.<init>(E4Workbench.java:73)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:293)
at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:534)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:520)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
I also tried the eclipse.exe -clean to launch it but getting same error.
I am new to JTA and it's underlying transaction managers. Can anyone explain the pros/cons of each of these? Feel free to add others I didn't list in title.
Also, don't the major applications servers (WebSphere, JBoss, Glassfish) have their own JTA compliant transaction manager? In those environments, would you still use these third party implementations?
Hello,
When I include a 'disabled' attribute on an a4j:commandButton, the button's action is not performed. Taking the 'disabled' attribute out causes it to work properly. I am not doing any special validation (that I'm aware of) and am not seeing any validation error messages.
Here is part of my page:
<t:dataTable id="myTable"
var="region"
value="#{MyPageBackingBean.regions}"
width="100%">
...
<a4j:commandButton value="Update"
action="#{region.doUpdate}"
oncomplete="alert('done');"
disabled="#{!empty region && region.messageEmpty}"
immediate="true"/>
...
</t:dataTable>
Any ideas? Thanks!
Edit:
I tried setting preserveDataModel="true" on the t:dataTable to no avail.
I also made a test having an a4j:commandButton and text box with no data table, but the backing bean action is still not being fired:
<h:form>
<a4j:region>
<a4j:outputPanel id="testregion">
<h:messages id="messages"/>
<a4j:status>
<f:facet name="start">
<h:graphicImage value="/images/progress_indicator.gif"/>
</f:facet>
</a4j:status>
<h:inputTextarea
rows="5"
value="#{MyPageBackingBean.myValue}"
style="width:100%; border: 1px solid #99CCFF;">
<a4j:support event="onkeyup"
reRender="testregion"
eventsQueue="messageModificationQueue"
ignoreDupResponses="true"
requestDelay="500"/>
</h:inputTextarea>
<a4j:commandButton id="doDelete"
value="Delete"
action="#{MyPageBackingBean.dummy}"
reRender="testregion"
disabled="#{empty MyPageBackingBean.myValue}"/>
<h:outputText value="#{MyPageBackingBean.myValue}"/>
</a4j:outputPanel>
</a4j:region>
</h:form>
Here is the new backing bean code used for testing:
private String m_myValue = null;
public String getMyValue()
{
return m_myValue;
}
public void setMyValue(String value)
{
m_myValue = value;
}
private String mystr2 = null;
public String dummy()
{
mystr2 = "hello";
return null;
}
Thanks!
Hi
In struts2 upload methods, can I choose where the uploaded file must be saved. I mean, all the examples in web ask me to store in WEB-INF which surely is not a good idea. I want to be able to store the uploaded file in any place in my disk.
How should i do it? Can i do it with help of ServletContextAware interceptor ?
I'm trying to write a custom servlet (for AJAX/JSON) in which I would like to reference my @ManagedBeans by name. I'm hoping to map:
http://host/app/myBean/myProperty
to:
@ManagedBean(name="myBean")
public class MyBean {
public String getMyProperty();
}
Is it possible to load a bean by name from a regular servlet? Is there a JSF servlet or helper I could use for it?
I seem to be spoilt by Spring in which all this is too obvious.
I show some detail using popup windows. I want to close those when the user clicks on sign-out link. I have a JavaScript function that'll close the windows.
The sign-out link is rendered using Navigation MenuModel. The definition in faces-config is as below -
<managed-bean>
<managed-bean-name>signoutNavigation</managed-bean-name>
<managed-bean-class>com.xxx.xxx.framework.NavigationItem</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
<managed-property>
<property-name>label</property-name>
<value>Sign Out</value>
</managed-property>
<managed-property>
<property-name>viewId</property-name>
<value>/signout.jsp</value>
</managed-property>
<managed-property>
<property-name>outcome</property-name>
<value>signout</value>
</managed-property>
<managed-property>
<property-name>onclick</property-name>
<value>closeOrderWindows()</value>
</managed-property>
</managed-bean>
The problem is when I use the "onclick" property on managed-bean, the page doesn't submit to "signout.jsp" and remains on same page.
When I remove/comment the "onclick" part, the page gets submitted properly.
I use MyFaces Trinidad.
Hi,
While loading a dll file, I am getting the following exception:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: D:\Transliteration\rlpnc-3.1.0-sdk-ia32-w32-msvc80\rlp\bin\ia32-w32-msvc80\btutiljni.dll
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.basistech.util.internal.Native.bootstrapUtilitiesJNI(Unknown Source)
at com.basistech.util.internal.Native.loadLibrary(Unknown Source)
at com.basistech.rnt.jni.(Unknown Source)
at com.basistech.rnt.RNTEnvironment.(Unknown Source)
at SampleTranslator.(TranslateNameSample.java:88)
at TranslateNameSample.main(TranslateNameSample.java:62)
not sure about the root cause of the issue. Can anybody help me out in resolving this issue.
Thanks,
Bhaskar
I'm attempting to upload a file into a jsp and then use the file in some other code. My problem is that it comes into the servlet as an Object via the request.getAttribute() call so I don't know what to cast it to.
I have this code so far to try and test what it is but I'm getting a NullPointerException.
PrintWriter out = response.getWriter();
out.println(request.getAttribute("file1").getClass());
Is my understanding of whats going on flawed or am I just coding it up wrong?
Part of my xhmtl-Page:
<rich:autocomplete autocompleteMethod="#{autocompletMit.searchbyName()}" mode="cachedAjax"
fetchValue="#{controller.mitarbeiter.mitarbeiterName}" autocompleteList="#{autocompletMit.autocompleteList}" minChars="1" autofill="true" var="it" >
<h:outputText value="#{it.mitarbeiterName}" style="font-weight:bold"/>
</rich:autocomplete>
Bean for my Autocomplete:
@ManagedBean(name = "autocompletMit")
@RequestScoped
public class AutoCompleteMitarbeiter implements Serializable {
@EJB
private Transaktionssteuerung transakt;
private List<String> autocompleteList = new ArrayList<String>();
String nameSearch;
public List<String> searchbyName(Object o) {
String test = (String) o; //always get here a NullPointerException
List<Mitarbeiter> alleMitarbeiter = transakt.alleMitarbeiter();
for (Iterator<Mitarbeiter> it = alleMitarbeiter.iterator(); it.hasNext();) {
if (it.next().getMitarbeiterName().startsWith(test)) {
autocompleteList.add(it.next().getMitarbeiterName());
}
}
return autocompleteList;
}
I always get a NullPointerException for String test = (String) o; I dont know how to get the StringInput correctly from </rich:autocomplete>-Input....