Daily Archives

Articles indexed Monday May 17 2010

Page 26/112 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Spring 3 DI using generic DAO interface

    - by Peders
    I'm trying to use @Autowired annotation with my generic Dao interface like this: public interface DaoContainer<E extends DomainObject> { public int numberOfItems(); // Other methods omitted for brevity } I use this interface in my Controller in following fashion: @Configurable public class HelloWorld { @Autowired private DaoContainer<Notification> notificationContainer; @Autowired private DaoContainer<User> userContainer; // Implementation omitted for brevity } I've configured my application context with following configuration <context:spring-configured /> <context:component-scan base-package="com.organization.sample"> <context:exclude-filter expression="org.springframework.stereotype.Controller" type="annotation" /> </context:component-scan> <tx:annotation-driven /> This works only partially, since Spring creates and injects only one instance of my DaoContainer, namely DaoContainer. In other words, if I ask userContainer.numberOfItems(); I get the number of notificationContainer.numberOfItems() I've tried to use strongly typed interfaces to mark the correct implementation like this: public interface NotificationContainer extends DaoContainer<Notification> { } public interface UserContainer extends DaoContainer<User> { } And then used these interfaces like this: @Configurable public class HelloWorld { @Autowired private NotificationContainer notificationContainer; @Autowired private UserContainer userContainer; // Implementation omitted... } Sadly this fails to BeanCreationException: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.organization.sample.dao.NotificationContainer com.organization.sample.HelloWorld.notificationContainer; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.organization.sample.NotificationContainer] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Now, I'm a little confused how should I proceed or is using multiple Dao's even possible. Any help would be greatly appreciated :)

    Read the article

  • Unable to delete a directory from NTFS drive: "Access is deined"

    - by Evgeny
    I'm running Windows XP Pro x64 SP2. I have a directory on an NTFS drive that was created by a Maven build. A subsequent build attempted to delete this directory and failed. I now get the error "Access is denied" whenever I try to do anything with that directory: change to it, delete it, rename it. This happens both in Windows Explorer and from a command prompt. The properties dialog in Windows Explorer doesn't even contain the Security tab. I created the directory, so I don't think this is truly a permissions issue. I've occasionally had this error happen in the past is well. I believe the error is misleading, but the question is: what is the real problem and how do I fix it?

    Read the article

  • Linux scp command issue

    - by George2
    Hello everyone, I am using scp command to copy file from a MacBook Pro OS X 10.5 to another Linux box (Red Hat Linux Enterprise 5). I am using the following command on Mac, sudo scp ~/.ssh/mykey.rsa [email protected], there is no output from Mac command line. I am not sure whether the scp is success or not. Where is the location the file mykey.rsa on remote computer 10.10.100.101? thanks in advance, George

    Read the article

  • CSS:Hover's problem with text that is hidden because of overflow:hidden ?

    - by Michael Harringon
    In my application i have lots of divs containing text. All divs have overflow set to hidden so that the user does not see the text if the container is not large enough to contain the writing. If the user wants to see the hidden text they are supposed to mouse over the "box". The box then expands and shows the text. Sounds simple enough, right? Well i am having problems and the solution i tried did not work. The problem is that when the user mouses over the box, the text does indeed appears but stays really narrow and comes out of the bottom box, the sameway it would if overflow was set to visible. below is the standard css applied to the div box: .newevent { overflow: hidden; z-index: 0; } I Tried to fix this by setting a hover trigger, when it is activated the box widens, i thought that this would then mean there would be more space to display the text, below is the hover effect: .newevent div:hover { width: 200px; padding: 50px; background-color:#D4D4D4; border: medium red dashed; overflow: visible; z-index: 1; } How do i go about "redrawing" the text when it is hovered over, so that the text can use the new widened area rather than behaving as it is still in a narrow box.

    Read the article

  • Python modify an xml file

    - by michele
    I have this xml model. link text So I have to add some node (see the text commented) to this file. How I can do it? I have writed this partial code but it doesn't work: xmldoc=minidom.parse(directory) child = xmldoc.createElement("map") for node in xmldoc.getElementsByTagName("Environment"): node.appendChild(child) Thanks in advance.

    Read the article

  • Want to set 'src' of script to my IP.

    - by Ozaki
    I have a script that links to the server I am hosting (IP can change) usually I would just use for links: var url ='http://' + window.location.hostname + 'end of url'; But in this case it isnt appearing to be so easy. I have tried: (1) $('#scriptid').attr('src', url); as well as: (2) var script = document.createElement( 'script' ); script.type = 'text/javascript'; script.src = url; $("#insert").append( script ); Now case (2) works loads the script runs the script. But when at the end of my script it hits the 'write data' it decides to replace the entire page with just the data. Any idea on how I can do this?

    Read the article

  • How to show GridView in tooptip in asp.net

    - by IrfanRaza
    Hello friends, Normally what happens, a single or more lines are shown as a tooltip. What I need is to show a gridview as a tooltip. Actually in my project i need to show all the notes associated with a stock in a gridview. Can anybody help me? Thanks for sharing your valuable time.

    Read the article

  • Cheap windows driver signing for 64 bit Windows 7

    - by kayahr
    I need to install the libusb-win32 driver on Windows 7 64 bit machines. This driver is open source so it is not digitally signed so I want to do this my self but I wonder if this can be done WITHOUT paying lot of money. Is it possible to use a certificate which is NOT signed by Verisign or GlobalSign? Maybe self-signed or by using StartSSL instead? And if yes, how do I do it? According to this howto I have to use a "cross-certificate" (And there are only six available on the Microsoft list and most of them are for CAs which are no longer active) I don't care if the user is confronted with a warning message. I can even accept if the user has to install a special CA certificate first. I only require that the driver runs without manually disabling the signature check on each windows startup.

    Read the article

  • Ad-Hoc mode and Cell (how does it work)?

    - by Ori Cohen
    hello, I am setting up a wireless Ad-Hoc network manually in linux using iwconfig and ifconfig. I have gotten everything working, and I think I understand it all except access point. The part that confused me is this: If I have essid='some_id', channel=11, Mode=Ad-Hoc and appropriate routing/ip on both laptops, why do I need to make sure the Cell is the same? I was under the impression that Ad-Hoc worked independently of the access point. I can easily get around this, I just use iwconfig wlan0 ap 00:00:00:00:00:01 Why is this necessary? I've been unable to find a good tutorial on this. If anyone can clear this up I'd appreciate it. Thanks

    Read the article

  • Rendering javascript at the server side level. A good or bad idea?

    - by davidhong
    I want to make it clear first: This isn't a question in relation to server-side Javascript or running Javascript server side. This is a question regarding rendering of Javascript code (which will be executed on the client-side) from server-side code. Having said that, take a look at below ASP.net code for example: hlRemoveCategory.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this?');") This is prescribing the client-side onclick event on the server-side. As oppose to: $('a[rel=remove]').bind('click', function(event) { return confirm('Are you sure you want to delete this?'); } Now the question I want to ask is: What is the benefit of rendering javascript from the server-side code? Or the vice-versa? I personally prefer the second way of hooking up client-side UI/behaviour to HTML elements for the following reasons: Server-side does what ever it needs to already, including data-validation, event delegation and etc; and What server-side sees as an event is not necessarily the same process on the client-side. i.e., there are plenty more events on client-side (just look at custom events); and What happens on client-side and on server-side, during an event, could be completely irrelevant and decoupled; and What ever happens on client-side happens on client-side, there is no need for the server to know. Server should process and run what is given to them, how the process comes to life is not really up to them to decide in the event of the client-side events; and so and so forth. These are my thoughts obviously. I want to know what others think and if there has been any discussions on this topic. Topics branching from this argument can reach: Code management: is it easier to render everything from server-side? Separation of concern: is it easier if client-side logic is separated to server-side logic? Efficiency: which is more efficient both in terms of coding and running? At the end of the day, I am trying to move my team to go towards the second approach. There are lot of old guys in this team who are afraid of this change. I just wish to convince them with the right facts and stats. Let me know your thoughts.

    Read the article

  • Why does my App.Config codebase not help .NET locate my assembly?

    - by pkolodziej
    I have the following client application and its corresponding config file: namespace Chapter9 { class Program { static void Main(string[] args) { AppDomain.CurrentDomain.ExecuteAssembly("AssemblyPrivate.exe"); } } } <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <codeBase href="file://C:\Users\djpiter\Documents\Visual Studio 2008\Projects\70536\AssemblyPrivate\bin\Debug\AssemblyPrivate.exe"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration> The AssemblyPrivate.exe does not have a public key, nor is it located in the GAC. As far as I know, the runtime should parse the app.config file before looking for an assembly in the client app directory. The unhandled exception (wrapped for readability) is: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Users\djpiter\Documents\Visual Studio 2008\Projects\70536\Chapter9\bin\Debug\AssemblyPrivate.exe' or one of its dependencies. The system cannot find the file specified. Why it is not working? I need to use dynamic binding (not static). Kind Regards, PK

    Read the article

  • What is the C# equivalent of java.util.regex?

    - by peter.murray.rust
    I am converting Java code to C# and need to replace the use of Java's regex. A typical use is import java.util.regex.Matcher; import java.util.regex.Pattern; //... String myString = "B12"; Pattern pattern = Pattern.compile("[A-Za-z](\\d+)"); Matcher matcher = Pattern.matcher(myString); String serial = (matcher.matches()) ? matcher.group(1) : null; which should extract a capture group from a matched target string. I'd be grateful for simple examples. EDIT: I have now added the C# equivalent of the code as an answer. EDIT: Here is a tutorial on the use of the actual expressions. EDIT: Here is a useful comparison of C# and Java (and Perl.)

    Read the article

  • How to display configurable product in each color in product listing?

    - by Thomas
    I have a configurable product which is available in many different colors and sizes. I want the configurable product to appear once for every color. My idea is to assign one simple product of the configurable product in every color to the category of the configurable product. Then I want to change the listing, so that the (colored) simple product links to it's master product (the configurable one). The other way would be, to just assign the configurable product to a category and then list it multiple times with different colors. But I think this would be to complicated.

    Read the article

  • Linq to XML - update/alter the nodes of an XML Document

    - by knox
    Hello! If got 2 Questions: 1. I've sarted working around with Linq to XML and i'm wondering if it is possible to change a XML document via Linq. I mean, is there someting like XDocument xmlDoc = XDocument.Load("sample.xml"); update item in xmlDoc.Descendants("item") where (int)item .Attribute("id") == id ... 2. I already know how to create and add a new XMLElement by simply using xmlDoc.Element("items").Add(new XElement(......); but how can i remove a single entry. XML sample data: <items> <item id="1" name="sample1" info="sample1 info" web="" /> <item id="2" name="sample2" info="sample2 info" web="" /> </itmes>

    Read the article

  • How do you use Linq2Sql in your applications ?

    - by this. __curious_geek
    I'm recently migrating to Linq2Sql and all my future projects would be done in Linq2Sql. Having said that, I researched a lot on how to properly plug-in Linq2Sql in application design. what to put at what layer ? Should I use DTOs over Linq2Sql entities ? I did not find any rock-solid material that really talked about one single thing and everyone had their own opinions and I found all of them justified right from their arguments. I'm looking forward to your ideas on how to integrate/use Linq2Sql in projects. My priority is maintenance[it should be maintenable and when multiple people work on same project] and scalabilty [it should have scope of evolution]. Thanks.

    Read the article

  • Wordpress Video Portal

    - by choise
    Hi out there, my challenge is to built a video portal, based on wordpress (blog already started). so in the backend there must be a option to add, tag, descripe videos and in frontend the videos must have a comment function, must be searchable and so on. wordpress gives already a large amout of functionallity and i want to use this, comments for example, but also categorisation and tagging. what is the best practise to built such a "plugin" ? where to start? what to use? custom tables and built everything by myself or can i use the blog functionallity to advantage? hopefully everything is clear, comment if not ;)

    Read the article

  • IP assignment in a /28 block

    - by mks
    Need help on setting up firewall router. My config is as below: Public static network ID: x.x.x.48/28 gateway: x.x.x.49 available IP for the hosts: x.x.x.52 to 62 gw_eth0 <-- fw_eth0 - fw_eth1 <-- dmz_switch Four servers are connected on dmz_switch (say s1, s2, s3, s4) all have to use public static IP address from the above block. Any recommendation on IP assignment and route setup? Do I need to subnet the above block further or simply use /32 netmask and point-to-point static routes in the above setup?

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >