Search Results

Search found 1156 results on 47 pages for 'roman zenka'.

Page 21/47 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • What are the principles of developing web-applications with action-based java frameworks?

    - by Roman
    Background I'm going to develop a new web-application with java. It's not very big or very complex and I have enough time until it'll "officially" start. I have some JSF/Facelets development background (about half a year). And I also have some expirience with JSP+JSTL. In self-educational purpose (and also in order to find the best solution) I want to prototype the new project with one of action-based frameworks. Actually, I will choose between Spring MVC and Stripes. Problem In order to get correct impression about action-based frameworks (in comparison with JSF) I want to be sure that I use them correctly (in bigger or lesser extent). So, here I list some most-frequent tasks (at least for me) and describe how I solve them with JSF. I want to know how they should be solved with action-based framework (or separately with Spring MVC and Stripes if there is any difference for concrete task). Rendering content: I can apply ready-to-use component from standard jsf libraries (core and html) or from 3rd-party libs (like RichFaces). I can combine simple components and I can easily create my own components which are based on standard components. Rendering data (primitive or reference types) in the correct format: Each component allow to specify a converter for transforming data in both ways (to render and to send to the server). Converter is, as usual, a simple class with 2 small methods. Site navigation: I specify a set of navigation-cases in faces-config.xml. Then I specify action-attribute of a link (or a button) which should match one or more of navigation cases. The best match is choosen by JSF. Implementing flow (multiform wizards for example): I'm using JSF 1.2 so I use Apache Orchestra for the flow (conversation) scope. Form processing: I have a pretty standard java-bean (backing bean in JSF terms) with some scope. I 'map' form fields on this bean properties. If everything goes well (no exceptions and validation is passed) then all these properties are set with values from the form fields. Then I can call one method (specified in button's action attribute) to execute some logic and return string which should much one of my navigation cases to go to the next screen. Forms validation: I can create custom validator (or choose from existing) and add it to almost each component. 3rd-party libraries have sets of custom ajax-validators. Standard validators work only after page is submitted. Actually, I don't like how validation in JSF works. Too much magic there. Many standard components (or maybe all of them) have predefined validation and it's impossible to disable it (Maybe not always, but I met many problems with it). Ajax support: many 3rd-party libraries (MyFaces, IceFaces, OpenFaces, AnotherPrefixFaces...) have strong ajax support and it works pretty well. Until you meet a problem. Too much magic there as well. It's very difficult to make it work if it doesn't work but you've done right as it's described in the manual. User-friendly URLs: people say that there are some libraries for that exist. And it can be done with filters as well. But I've never tried. It seems too complex for the first look. Thanks in advance for explaning how these items (or some of them) can be done with action-based framework.

    Read the article

  • Can I have two names for the same variable?

    - by Roman
    The short version of the question: I do: x = y. Then I change x, and y is unchanged. What I want is to "bind" x and y in such a way that I change y whenever I change x. The extended version (with some details): I wrote a class ("first" class) which generates objects of another class ("second" class). In more details, every object of the second class has a name as a unique identifier. I call a static method of the first class with a name of the object from the second class. The first class checks if such an object was already generated (if it is present in the static HashMap of the first class). If it is already there, it is returned. If it is not yet there, it is created, added to the HashMap and returned. And then I have the following problem. At some stage of my program, I take an object with a specific name from the HashMap of the first class. I do something with this object (for example change values of some fields). But the object in the HashMap does not see these changes! So, in fact, I do not "take" an object from the HashMap, I "create a copy" of this object and this is what I would like to avoid.

    Read the article

  • How can I create a self-consistent .jar file with Eclipse?

    - by Roman
    I wrote my Java application in Eclipse. Now I would like to generate a .jar file which can be run on other systems from the command line. Is there a easy way to do it in Eclipse? In particular I am wondering what should I do with the jar files of external library that I use (should it be included into my .jar file?). Moreover, should I generate some manifest files?

    Read the article

  • Is it OK to write a constructor which does nothing?

    - by Roman
    To use methods of a class I need to instantiate a class. At the moment the class has not constructor (so I want to write it). But than I have realized that the constructor should do nothing (I do need to specify values of fields). In this context I have a question if it is OK to write constructor which does nothing. For example: public Point() { }

    Read the article

  • How to make cycle over cycles in Java?

    - by Roman
    I would like to make a cycle over the following elements: [1,2,11,12,21,22,111,112,121,122,....,222222] or for example [1,2,3,11,12,13,21,22,23,31,32,33,111,112,113,... 333333333] How can I make it in Java? In my particular case I use 4 digits (1,2,3,4) and the length of the last number can be from 1 to 10. I managed to do it in Python and PHP. In the first case I used list over lists. I started from [[1],[2],] then for every element of the list I added 1 and 2, so I got [[1,1],[1,2],[2,1],[2,2]] and so on: nchips = sum(chips) traj = [[]] last = [[]] while len(last[0]) < nchips: newlast = [] for tr in last: for d in [1,2,3,4]: newlast.append(tr + [d]) last = newlast traj += last When I did it in PHP I used number with base 3. But it was a tricky and non elegant solution. for ($i=-1; $i<=$n; $i+=1) { if ($i>-1) { $n5 = base_convert($i,10,5); $n5_str = strval($n5); $tr = array(); $found = 0; for ($j=0; $j<strlen($n5_str); $j+=1) { $k = $n5_str[$j]; if ($k==0) { $found = 1; break; } array_push($tr,$k); } if ($found==1) continue; } else { $tr = array(); } } Can it be done easily in Java?

    Read the article

  • I have a feeling that adding fields marked with @Transient annotation to entity is very bug-prone. A

    - by Roman
    I have some philosophical feeling that adding to an entity fields which doesn't mapped to the DB is a wrong way of solving problems. But are there any concrete situations where using @Transient fields leads to implicit and hard fixing problems? For example, is it possible that adding/removing 2nd level cache will break our app when there are @Transient fields in our entities?

    Read the article

  • PreparedStatement and setTimestamp in oracle jdbc

    - by Roman
    Hi everyone, I am using PreparedStatement with Timestamp in where clause: PreparedStatement s=c.prepareStatement("select utctimestamp from t where utctimestamp>=? and utctimestamp<?"); s.setTimestamp(1, new Timestamp(1273017600000L)); //2010-05-05 00:00 GMT s.setTimestamp(2, new Timestamp(1273104000000L)); //2010-05-06 00:00 GMT The result I get is different, when I have different time zones on the client computer. Is this a bug in Oracle jdbc? or correct behavior? The parameter is Timestamp, and I expected that no time conversions will be done on the way. The database column type is DATE, but I also checked it with TIMESTAMP column type with the same results. Is there a way to achieve correct result? I cannot change default timezone in the the whole application to UTC. Thanks for your help

    Read the article

  • How to import a package from Eclipse?

    - by Roman
    In one of my directories I have all .java files which belong to one package ("game"). Now I want to create one .java file which does not belong to this package and which imports the "game" package. If I create a new file and write import game; then Eclipse complains that it does not know what the "game" package means. Can somebody please help me to solve this problem?

    Read the article

  • Can fields of the class and arguments of the method interfere?

    - by Roman
    I have a class with a fields called "a". In the class I have a method and in the list of arguments of this method I also have "a". So, which "a" I will see inside of the method? Will it be the field or it will be the argument of the method? public class myClass { private String a; // Method which sets the value of the field "a". public void setA(String a) { a = a; } } By the way, there is a similar situation. A method has some local (for method) variables whose names coincide with the names of the fields. What will the "see" the method if I refer to such a method-local variable inside the method (the field or the local variable)?

    Read the article

  • Does importing of packages change visibility of classes?

    - by Roman
    I jsut learned that A class may be declared with the modifier public, in which case that class is visible to all classes everywhere. If a class has no modifier (the default, also known as package-private), it is visible only within its own package. This is a clear statement. But this information interfere with my understanding of importing of packages (which easily can be wrong). I thought that importing a package I make classes from the imported package visible to the importing class. So, how does it work? Are public classes visible to all classes everywhere under condition that the package containing the public class is imported? Or there is not such a condition? What about the package-private classes? They are invisible no mater if the containing package was imported or not? ADDED: It seems to me that I got 2 answers which are marked as good (up-voted) and which contradict eachother.

    Read the article

  • Good simple C/C++ FTP and SFTP client library recommendation for embedded Linux

    - by Roman Nikitchenko
    Could anyone recommend FTP / SFTP client C/C++ library for Linux-based embedded system? I know about Curl library but I need something as simple as possible just to download files from FTP / SFTP servers. Is there any recommendation to look for? Yes, SFTP support is critical. Actually I can even sacrifice multi-threading because I need only one stream at a time. And I'd like it to be able to work through memory buffers but this should be not a problem. Thank you in advance.

    Read the article

  • How to achieve "merge" of two data sets with Insert SQL statemen (Oracle DBMS)t?

    - by Roman Kagan
    Hi: What would be the insert SQL statement to merge data from two tables. For example I have events_source_1 table (columns: event_type_id, event_date) and events_source_2 table (same columns) and events_target table (columns: event_type_id, past_event_date nullalbe, future_event_date nullable). Events_source_1 has past events, Events_source_2 has future events and resultant events_target would contain past and future events in the same row for same event_type_id. If there is no past_events but future_events then past_event_date won't be set and only future_event_date will be and the opposite is true too. Thanks a lot in advance for helping me resolving this problem.

    Read the article

  • How to force my method to accept objects from external software?

    - by Roman
    I have a method which needs to take a callback object as an argument and then (at the moment when it's needed) my method will call a specific method of the callback object. I wrote a class called Manager which has a method called addListener. As the argument for this method I need to use a callback object which is defined by the external software. So, I define the addListener in the following way: public void addListener(Listener listener). Of course Eclipse complains because it does not know what Listener is (because the Listener is defined by the external software). The only think that I know (should know) about the Listener is that it has a method called doSomething. So, to pleasure Eclipse I add an interface before my Manager class: interface Listener { void doSomething(); } public class CTManager { ... The problem seems to be solved but then I try to test my software. So, I create a class called test. In this class I create an instance of the Manager class and try to use addListener method of this instance. I also create a class Listener, instantiate it and give the instance to the addListener. And it's the place where the problem appears. Eclipse writes that addListener is not applicable to the given argument. I think it's because it expect something from my Listenr interface but gets something from the Listener class. How can I solve this problem?

    Read the article

  • Where should I put interface?

    - by Roman
    I program a class in which I have a method which takes an callback object from an external software. At the moment Eclipse says that it does not know the type of the object I gave as argument (it is expectable since I do not specify this type, it's done by the external software). So, I think I need to write an interface for the object which I give as an argument to my method. In this respect I have two questions. Is it really so? Can I solve the mentioned problem in the mentioned way. If it is the case, where should I put this interface? In the same file where my class is? In the class? Outside of the class?

    Read the article

  • Are there any way to apply regexp in java ignoring letter case?

    - by Roman
    Simple example: we have string "Some sample string Of Text". And I want to filter out all stop words (i.e. "some" and "of") but I don't want to change letter case of other words which should be retained. If letter case was unimportant I would do this: str.toLowerCase().replaceAll ("a|the|of|some|any", ""); Is there an "ignore case" solution with regular expressions in java?

    Read the article

  • Can I run two web servers on the same computer?

    - by Roman
    I just found out that I can write a really simple web server using Python. I have already an Apache web server I would like to try the Python based web server on this machine. But I am afraid that I can get some kind of conflict if I try it. I mean how two web server will "decide" who needs to server a request from a client?

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >